ECE 2030 11 00am Computer Engineering 5 problems 6 pages Final Exam Fall 2003 12 December 2003 Instructions This is a closed book closed note exam Calculators are not permitted If you have a question raise your hand and I will come to you Please work the exam in pencil and do not separate the pages of the exam For maximum credit show your work Good Luck Your Name please print 1 2 3 4 5 total 44 28 26 30 22 150 1 ECE 2030 11 00am Computer Engineering 5 problems 6 pages Final Exam Problem 1 6 parts 44 points Fall 2003 12 December 2003 Assembly Language Fun Part A 7 points Write an MIPS fragment that places 0x12345678 in 3 label instruction comment Part B 7 points Write a MIPS fragment that exchanges 1 and 2 without modifying any other registers label instruction comment Part C 7 points Write a MIPS fragment that pops a value from the stack into 4 The SP is 30 label instruction comment Part D 7 points Write a MIPS fragment that branches to SKIP if 5 is greater than 25 label instruction comment Part E 9 points List three differences between a branch and a jump in the MIPS instruction set 1 2 3 Part F 7 points Explain the need for byte addressing in today s microprocessors Byte addressing is needed to support 2 ECE 2030 11 00am Computer Engineering 5 problems 6 pages Final Exam Fall 2003 12 December 2003 instruction example meaning add subtract add immediate multiply divide and or xor and immediate or immediate xor immediate shift left logical shift right logical shift left arithmetic shift right arithmetic load word store word load upper immediate branch if equal branch if not equal set if less than set if less than immediate jump jump register jump and link add 1 2 3 sub 1 2 3 addi 1 2 100 mul 1 2 3 div 1 2 3 and 1 2 3 or 1 2 3 xor 1 2 3 andi 1 2 100 ori 1 2 100 xori 1 2 100 sll 1 2 5 srl 1 2 5 sla 1 2 5 sra 1 2 5 lw 1 2 sw 1 2 lui 1 100 beq 1 2 100 bne 1 2 100 slt 1 2 3 slti 1 2 100 j 10000 jr 31 jal 10000 1 2 3 1 2 3 1 2 100 1 2 3 1 2 3 1 2 3 1 2 3 1 2 xor 3 1 2 100 1 2 xor 1 1 2 100 1 2 5 logical 1 2 5 logical 1 2 5 arithmetic 1 2 5 arithmetic 1 memory 2 memory 2 1 1 100 x 216 if 1 2 PC PC 4 100 4 if 1 2 PC PC 4 100 4 if 2 3 1 1 else 1 0 if 2 100 1 1 else 1 0 PC 10000 4 PC 31 31 PC 4 PC 10000 4 Problem 2 4 parts 28 points Assembly Language Consider the following MIPS program fragment The instruction set is listed below address label instruction 1000 1004 1008 1012 1014 1020 skip1 slt bne jal addi sw j 3 1 0 3 0 skip1 foo 2 0 0x100 3 2 Next Part A 7 points What is the branch offset in bytes for the bne instruction branch offset in bytes Part B 7 points For what values of 1 will subroutine foo be called values of 1 in decimal Part C 7 points What does 31 contain when subroutine foo begins execution contents of 31 in decimal Part D 7 points If Foo produces a single result which register is most likely to contain it when Foo returns Explain your answer 3 ECE 2030 11 00am Computer Engineering 5 problems 6 pages Final Exam Problem 3 2 parts 26 points Fall 2003 12 December 2003 Karnaugh Maps Part A 13 points For the follow expression derive a simplified product of sums expression using a Karnaugh Map Circle and list the prime implicants indicating which are essential Out A C D A B C D A B C essential yes no prime implicants B B C A C A C D D D simplified POS expression Part B 13 points For the follow expression derive a simplified sum of products expression using a Karnaugh Map Circle and list the prime implicants indicating which are essential Out A B D B C D A B C D essential yes no prime implicants B B C A C A C D D D simplified SOP expression 4 ECE 2030 11 00am Computer Engineering 5 problems 6 pages Final Exam Fall 2003 12 December 2003 Problem 4 3 parts 30 points Counters Part A 10 points Design a toggle cell using transparent latches and basic gates Include a toggle enable TE active low clear CLR clocks PHI1 and PHI2 Label the output OUT Part B 10 points Use toggle cells to build a divide by six counter with active high inputs CE and CLR and a max count output MAX Do not draw the clock signals Label all signals CEOut Toggle Clr CEOut Toggle Clr CEOut Toggle Clr Part C 10 points Use divide by six and ten counters plus needed gates to build a stop watch Include an external count enable CE and clear CLR Assume a one cycle second 1 Hz clock divide by 6 max CE CLR divide by 10 max CE CLR divide by 6 max CE CLR CLR divide by 10 max CE CLR CE 5 ECE 2030 11 00am Computer Engineering 5 problems 6 pages Final Exam Fall 2003 12 December 2003 Problem 5 3 parts 22 points Building Blocks Part A 8 points Implement a 2 to 4 decoder using only AND gates Assume inputs signals IN0 IN1 and En and their complements are available Label all inputs and outputs Part B 10 points Complete the truth table below to describe the behavior of the following circuit A B Out C D Out0 Y In0 Z In1 1 En D 1 0 0 1 1 0 2 to 4 decoder Out1 Out2 Out3 C 1 0 1 0 1 1 B 1 1 0 0 0 0 A 0 1 0 0 0 1 Z 0 0 0 1 1 1 Y 0 1 1 0 0 1 Out Part C 4 points Name the building block implemented in part B It s a 6
View Full Document