Lecture 17

# Lecture 17 - ECE52 Spring 11 Lecture 17 Lab this week ADC...

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

1 ECE52 Spring 11 Lecture 17 2/21/11 Lab this week: ADC Lunch: Wednesday, noon-1ish, LSRC

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

View Full Document
2 1’s, 2’s complement - examples 63-27: What is minimum number of bits this calculation can be conducted in?
3 1’s, 2’s complement - examples 63-27: What is minimum number of bits this calculation can be conducted in? 7, since 2 6 =64; 63=0111111; MUST have leading zero to indicate positive number!

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

View Full Document
4 1’s, 2’s complement - examples 63-27: 1’s 2’s 0111111 0111111 +1100100 (since 011011=27) + 1100101 10100011 10100100 +1 0100100
2’s complement overflow rules Convert all add/subtract to addition x-y=x+(-y) in 4 bit world: 2+1 is fine, but 6+5? (-3)+(-2) is fine, but (-4)+(-7)? how about any legal positive number plus any legal negative number? RULE: If signs of operands match and differ from sign of answer, OVERFLOW! if signs of operands differ, overflow not possible! 5

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

View Full Document
6 Downside of 1’s, 2’s – loss of simple positional representation • In 4-bit unsigned, 1011 = 11 10 means 1x2 3 +0x2 2 +1x2 1 +1x2 0 In 4-bit 2’s complement, 1011 = -5 no longer has this nice simple interpretation! Your book, and ECE152, discuss some tricks for interpreting values of 2’s complement numbers rapidly – turns out we are ok: 1011= -1x2 3 +0x2 2 +1x2 1 +1x2 0
7 Multiplication: repeated addition (not the ultimate way to do multiplication though!) circuit to multiply 8-bit number by 3 7 x 0 y 7 y 0 x 7 x 0 y 8 y 0 y 7 x 8 s 0 s 7 c 7 0 s 0 s 8 c 8 P 9 P 8 P 0 P 3 A = : (a) Naive approach a 7 A : a 0 x 3A=A+A+A top adder: A+A=2A 8-bit adder, 9-bit result bottom adder: 2A+A=3A 9-bit adder, 10-bit result

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

View Full Document
8 Better solution: drops an important concept in passing – shifting! recognize 2A is just A shifted over one bit position to the left! 11010 26 1101 13 number) binary digit (9 0 law) ive (distribut 0 2 2 ... 2 2 2 2 ... 2 2 10 10 0 1 2 3 4 5 6 7 1 0 2 1 7 6 8 7 0 1 1 6 6 7 7 0 1 2 3 4 5 6 7 = = = + × + × + + × + × = + × + + × + × = = a a a a a a a a a a a a A a a a a a a a a a a a a A
9 So 3A is 2A+A x 1 x 0 y 8 y 0 y 7 x 8 s 0 s 8 c 8 0 0 a 7 A : P 9 P 8 P 0 P 3 A = : (b) Efficient design a 0 Circuit that multiplies an eight-bit unsigned number by 3 with a single 9-bit adder with 10-bit result.

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

View Full Document
10 So 3A is 2A+A x 1 x 0 y 8 y 0 y 7 x 8 s 0 s 8 c 8 0 0 a 7 A : P 9 P 8 P 0 P 3 A = : (b) Efficient design a 0 Circuit that multiplies an eight-bit unsigned number by 3 with a single 9-bit adder with 10-bit result. We note that a circuit that only multiplies by 3 is of rather limited utility in most situations! Much better solutions in ECE152.
11 VHDL, take 2 We introduced VHDL with just BIT types – legal values 0 and 1 only, but we have seen that Z and d (high impedance and don’t care) are also important states in practical

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 07/05/2011 for the course ECE 52 taught by Professor Dr.jonathanboard during the Spring '11 term at Duke.

### Page1 / 30

Lecture 17 - ECE52 Spring 11 Lecture 17 Lab this week ADC...

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

View Full Document
Ask a homework question - tutors are online