# Ch2 - EE306 IntroductiontoComputing...

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

Ramesh Yerraballi 2-1 EE 306 Introduction to Computing Chapter 2: Bits, Data Types and  Operations

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

View Full Document
Ramesh Yerraballi 2-2 Data Representation Symbols Numbers: 0,1,2 . .9 Alphabet: A-Z,a-z Other: +*-=/… Why not use multiple  voltages to represent  Numbers? Say 0v = 0; 0.1v=1;  0.2v=2;… Keep it simple Binary  Presence of voltage  -> 1 Absence of voltage  -> 0 Notation lengthy but  easy!
Ramesh Yerraballi 2-3 Decimal Numbers “decimal” means that we have ten  digits to use in our  representation (the symbols  0 through 9) What is 3,546? it is  three  thousands  plus  five  hundreds  plus  four  tens  plus  six   ones . How about negative numbers? we use two more symbols  to distinguish positive and negative:  +  and  -

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

View Full Document
Ramesh Yerraballi 2-4 Unsigned Binary Integers 3-bits 5-bits 8-bits 0 000 00000 00000000 1 001 00001 00000001 2 010 00010 00000010 3 011 00011 00000011 4 100 00100 00000100 Y = “abc” = a.2 2 + b.2 1 + c.2 0 N = number of bits Range is: 0 i < 2 N - 1 (where the digits a, b, c can each take on the values of 0 or 1 only) Problem: How do we represent negative numbers?
Ramesh Yerraballi Signed Magnitude Leading bit is the sign  bit -4 10100 -3 10011 -2 10010 -1 10001 -0 10000 +0 00000 +1 00001 +2 00010 +3 00011 +4 00100 Range is: -2 N-1 + 1 < i < 2 N-1 - 1 Y = “abc” = (-1) a (b.2 1 + c.2 0 ) Problems: How do we do addition/subtraction? We have two numbers for zero (+/-)!

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

View Full Document
Ramesh Yerraballi 2-6 One’s Complement Invert all bits -4 11011 -3 11100 -2 11101 -1 11110 -0 11111 +0 00000 +1 00001 +2 00010 +3 00011 +4 00100 Range is: -2 N-1 + 1 < i < 2 N-1 - 1 If msb (most significant bit) is 1 then the number is negative (same as signed magnitude) Problems: Same as for signed magnitude
Ramesh Yerraballi 2-7 Two’s Complement - Idea Arithmetic Logic Unit  (ALU) part of the CPU  performs all  computations Nice to have a  representation for binary  numbers so that, A+ (-A)  = 0 (when we add a

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.

## Ch2 - EE306 IntroductiontoComputing...

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

View Full Document
Ask a homework question - tutors are online