You are on page 1of 3
wame: KEY STID: (COE 341 Fall 2008-9 Major IT 1) 25 points) The contents of some of the registers in micl are given below. Give the contents of registers after execution of the code in MIR. The code in MIR is given below. (All numbers are hex.) fofofafa fafa Tafof afofof fo] af: ihbphh pebp bh [ohhh J Mer a ee eee Tete an ft. se Before execution register values are: ‘After execution values will be; = MBR=0A MPC= 0011 LiL © 00000001 He 90112400 ‘TOS= 00001122 TOS= cop 12 ACK SS” Mob PC=00000015 Qocoti74 7 OP1I24OD PC= 0000 oo) > CPP=AOCOIOI2 SP= 0011 1490 Tost +1 D> H, ofc, LY, SP WH, Ph, Bo Fe (MBR OR Nit.sid) 2) (95 points) You are asked t8 help Nihal to design a speciat grapes procesior which has special instructions for image processing, (Processor is Mic! based.) One of the instructions is supposed logically OR the two neighboring pixel values and push the result into the involved local variables. The instruction is as follows; NIHAL varnum: ‘Varnum is a byte size number. Description: (Varnum is offset to LV.) The data contained in pointed local variable ‘and the next location is logically ORed and the result is pushed into the involved local ae Vopient OR epermter (LV+varnum) = (LV4+varnum) + (LV+(varnum+1)) mand Te =Pe +s | Fete, pete MAR nied HeLV ee maa = He MRQM; od ee man = Mae +] WheLY H = Ma 56d nike ds Mar- MAe- Aha Mom = WH OR moQ sur mhea Dd Po = Pol » fetch ene! wibel ¥ fete mand — peed te fetorn He eo uit, 5 — Need Le seen Herp ee 5 — Ratt OR HK volus -5 — Nmap shale be Ment -5 = mens shuld ke the -3 3) (40 points) Write the microcode for the following instruction for Mic? machine: ABDULGHANI varnum, offset \Varnum is 8 bit and offset are 16 bit numbers. ABDULGHANT instruction should ‘add contents of local variable varnum to the top value of stack. + Ifthe result ofthe addition is zero, it should push the local variable to stack and jump to ‘offset location and continue execution from that point. Ifthe result is not zero, you should pop the stack and continue with the following instruction. maa = W+MBRIW | od orc = Pcl z= Tos +mvrR 14 (2) ye ts eae mag = Sp= SPH) WO TOS =MoQ_ Pcz @Pc + magur gets meet Mags sez SP-\ He me2u2- Jt waste it | Tos = 2A) pate Mand got —Shevld ead Cambends + Vater -& = She ld add + Pos cee -Ss = should test property ---- > P —IPT shai pashte shack 8 = — «Sip load offset ie -s = She ld Sat Br fedek -5 Sp F sheld pop stack ss ae » skip offer cane — oS, Shald son Tas =>

You might also like