sp09-sw-sf - ECE 2030 12:00pm 5 problems, 5 pages Problem 1...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 2030 12:00pm Computer Engineering Spring 2009 5 problems, 5 pages Final Exam Solutions 1 May 2009 1 Problem 1 (4 parts, 32 points) Implementation Bonanza For each part implement the specified device. Label all inputs and outputs . Part A (8 points) Implement the expression below using N and P type switches. E D C B A OUT X + + = C B E D OUT X A A B C D E Part B (8 points) Implement the expression in mixed logic notation using NAND gates. ) ( D C B A OUT Y + + = A B C D OUTY Part C (8 points) Implement a 2 to 4 decoder with enable using basic gates. O 0 S 0 S 1 S 0 S 1 O 1 O 2 O 3 EN S 1 EN S 0 EN EN S 0 S 1 Part D (8 points) Write a POS expression for a two-input XOR (odd parity) using maxterms. A B A XOR B 0 0 0 1 0 1 0 1 1 1 1 0 ( ) ( ) B A B A Out + + =
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ECE 2030 12:00pm Computer Engineering Spring 2009 5 problems, 5 pages Final Exam Solutions 1 May 2009 2 Problem 2 (6 parts, 32 points) Alien Software SETI has just received an interesting message from deep space. While the comments are written in an alien tongue, they appear to write programs in MIPS assembly. Intergalactic scientists have only been able to decode the register assignments. Computer engineers must take it from there. # INPUTS: $1= num elements, $2= array A pointer, $3= array B pointer, # OUTPUT: $6=result, WORKING: $4= InA/diff, $5= InB/pred, # label instruction comment L1 WhatsIt: sub $6, $6, $6 # clear max difference L2 Loop: lw $4, ($2) # load A element L3 lw $5, ($3) # load B element L4 sub $4, $4, $5 # compute difference L5 slt $5, $4, $0 # if difference >= 0 L6 beq $5, $0, Skip1 # then skip L7 sub $4, $0, $4 # otherwise negate L8 Skip1: slt $5, $6, $4 # if MaxDif >= difference L9 beq $5, $0, Skip2 # then skip L10 add $6, $4, $0 # otherwise update MaxDif L11 Skip2: addi $2, $2, 4 # increment A ptr L12 addi $3, $3, 4 # increment B ptr L13 addi $1, $1, -1 # decrement element count L14 bne
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

sp09-sw-sf - ECE 2030 12:00pm 5 problems, 5 pages Problem 1...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online