hw4sol

# hw4sol - C-355 Solutions to HW 4 Q1 5 bits are needed to...

This preview shows pages 1–2. Sign up to view the full content.

C-355 Solutions to HW # 4 Q1: 5 bits are needed to represent 23 and 29 in unsigned representation Multiplicand = 23 = 10111 Multiplier = 29 = 11101 C A Q M Remarks Count 0 00000 11101 10111 Intitialize 5 + 10111 Q0=1 , add 0 10111 11101 0 01011 11110 Shift right 4 0 00101 11111 Q0=0, shift 3 +10111 Q0=1, add 0 11100 11111 0 01110 01111 Shift right 2 +10111 Q0=1, add 1 00101 01111 0 10010 10111 Shift right 1 +10111 Q0=1, add 1 01001 10111 0 10100 11011 Shift right 0 Product is in A , Q = 1010011011 = 512+128+16+8+2+1= 667 Q2: 4 bits are needed to represent 5 and -6 Q=0101 (5), M=1010 (-6) A Q Q_-1 M 0000 0101 0 1010 - 1010 (1) (0) ----------------------------------------------------------------------- 0110 0101 0 1010 shift 0011 0010 1 1010 (1st cycle) + 1010 (0) (1) ----------------------------------------------------------------------- 1101 0010 1 1010 shift 1110 1001 0 1010 (2nd cycle) - 1010 (1) (0) ------------------------------------------------------------------------ 0100 1001 0 1010 shift 0010

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 3

hw4sol - C-355 Solutions to HW 4 Q1 5 bits are needed to...

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

View Full Document
Ask a homework question - tutors are online