Lecture 14

# Lecture 14 - ECE52 Spring 11 Lecture 14 2/14/11 Watson vs...

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

1 ECE52 Spring 11 Lecture 14 2/14/11 Watson vs Humans? Digilunch Wednesday noon LSRC

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

View Full Document
2 Base 2 B = b n-1 b n-2 …b 1 b 0 So n-bit number can represent numbers from 0 to 2 n - 1 Left-most bit associated with highest power of 2: Most Significant Bit - MSB Right-most bit associated with 2 0 (i.e. 1’s place): Least Significant Bit - LSB - = - - - - × = × + × + + × + × = 1 0 0 0 1 1 2 2 1 1 2 2 2 ... 2 2 ) ( n i i i n n n n b b b b b B V
3 Examples – 8 bits • What is 10010010 2 in decimal? What is largest 8-bit binary number? What is smallest 8-bit binary number? • How do you represent 85 10 as an 8-bit binary number? • How do you represent 565 10 as an 8-bit binary number?

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

View Full Document
4 Examples – 8 bits • What is 10010010 2 in decimal? 146 What is largest 8-bit binary number? 255 What is smallest 8-bit binary number? 0 • How do you represent 85 10 as an 8-bit
5 Base Conversion Converting binary to decimal is straightforward – just apply and note you could work left-to-right or right-to-left! Decimal to binary is a little more tricky – one way is to work left-to-right, determining lead power of 2 first for 85, by inspection it lies between 64 and 128 so we start with 2 6 , then 85-64=21 left. 21: smaller than 32 so 0 for 2 5 , greater than 16 so 1 for 2 4 , etc. etc. Tricky part is the “by inspection”! - = × = 1 0 2 ) ( n i i i b B V

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

View Full Document
6 Another conversion method: successive divide-by-2 (in book) • Given k-digit decimal number D=d k-1 …d 0 it will eventually have n-digit binary representation B=b n-1 …b 0 – we don’t know it yet (or even n yet!) but it exists As always, If we divide V/2: 0 1 1 2 2 1 1 2 ... 2 2 ) ( ) ( b b b b V B V D V n n n n + × + + × + × = = = - - - - 2 2 ... 2 2 2 0 0 1 3 2 2 1 b b b b V n n n n + × + + × + × = - - - -
7 We’re really just determining if V was even or odd! Expressed as integer division, remainder of V/2 was just b 0 , So if V/2 has no remainder (i.e. the number was even) b 0 must have been 0!

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 / 26

Lecture 14 - ECE52 Spring 11 Lecture 14 2/14/11 Watson vs...

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

View Full Document
Ask a homework question - tutors are online