l16_ece15a_2

# l16_ece15a_2 - ECE 15A Fundamentals of Logic Design Lecture...

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

1 ECE 15A Fundamentals of Logic Design Lecture 16 Malgorzata Marek-Sadowska Electrical and Computer Engineering Department UCSB 2 Today: overview ± Subtraction with complements ± Arithmetic circuits ± Examples ² ROM-based circuits ² MUX-based circuits ² LUTs as circuit elements ² PLA-based circuits ± Test pattern generation ± Data transfer

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

View Full Document
2 3 Subtraction with Complements ± M,N are n-digit numbers, base r n n r N M N r M + = + ) ( We want to compute M-N 1. r’s complement 2. . , , left is N M discarded is which r carry end N M If n 3. . ' ) ( ' ) ( complement s r take M N of complement s r an is M N r carry end no N M If n < 4 Example g One’s complement of a binary number is found by subtracting the binary number to be complemented from a binary number made up of all 1s. Find the one’s complement of 10110010 11111111 -10110010 01001101 One’s complement of a binary number: change 1 to 0 and 0 to 1 in the original number. g Application: 10110011 <=> 1 0 1 1 0 0 1 1 -01101101 + 1 0 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 1 0 10 0 0 1 1 0 ( one’s complement) (end around carry) The difference The carry out of the MSB is added to LSB (end around carry)
3 5 Two’s complement of a binary number g Add 1 to the one’s complement Example: Find two’s complement of 1 0 0 1 1 1 0 1 one’s complement: 0 1 1 0 0 0 1 0 + 1 0 1 1 0 0 0 1 1 (two’s complement) Application: 01100111 -01001010 <=> 0 1 1 0 0 1 1 1 + 1 0 1 1 0 1 1 0 1 0 0 0 1 1 1 0 1 (answer) The carry resulting from the most significant bit is ignored. 6 Signed binary number ± Sign: leftmost position ² 0 - positive ² 1 - negative ± Example of a Signed Magnitude System 01011 is (11) if assumed unsigned binary 10 or + (11) if signed binary 10 11011 is (27) if assumed unsigned binary 10 or - (11) if signed binary 10

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

View Full Document
4 7 Signed complement system A negative number is indicated by its complement. 2’s complement is the most common. Example: +11 : 00001011 -11 : 10001011 (signed magnitude) 11110100 (signed one’s complement) 11110101 (signed two’s complement) Signed 2’s complement has only one representation for 0 (+) 8 Arithmetic addition ± Numbers: signed binary ± Negative numbers: 2’s complement ± Add including the sign bits ± A carry out of the sign -> discarded ± Change subtraction to addition ± Take 2’s complement of the subtrahend Arithmetic subtraction (+-A) - (+B) = (+-A) + (-B) (+-A) - (-B) =(+-A) + (+B)
5 9 Example 11100010 - 11000111

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.

## This note was uploaded on 05/29/2009 for the course ECE 15A taught by Professor M during the Winter '08 term at UCSB.

### Page1 / 19

l16_ece15a_2 - ECE 15A Fundamentals of Logic Design Lecture...

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

View Full Document
Ask a homework question - tutors are online