Presentation is loading. Please wait. # Digital Computers and Information

## Presentation on theme: "Digital Computers and Information"— Presentation transcript:

Digital Computers and Information
Chapter 1 (1.1 through 1.6) Digital Computers and Information Based on “Logic and Computer Design Fundamentals”, by Mano and Kime, Prentice Hall

Announcements Homework problem set 1 will be posted on the class website. Due: Wednesday 1/23/2013

Overview: you will learn
Information Representation Number Systems [binary, octal and hexadecimal] Base Conversion Decimal Codes [BCD (binary coded decimal)] Alphanumeric Codes Parity Bit Gray Codes

1-1 INFORMATION REPRESENTATION in Digital Systems- Signals
Information variables represented by physical quantities.  For digital systems, the variables take on discrete values. Two levels or binary values are the most prevalent values in digital systems.  Binary values are represented abstractly by: digits 0 and 1 words (symbols) False (F) and True (T) words (symbols) Low (L) and High (H) and words Off and On.

Signal Examples Over Time
Analog Continuous in value & time Asynchronous Digital Discrete in value & continuous in time Discrete in value & time Synchronous with the clock

Advantage of Digital Circuit
Immunity to noise Illustration: Noise added Receiver Sender Signal Signal

Immunity to noise: Noise Margin
VOH NMH VIH Forbidden VIL NML VOL Threshold Region The HIGH range typically corresponds to binary 1 and LOW range to binary 0. The threshold region is a range of voltages for which the input voltage value cannot be interpreted reliably as either a 0 or a 1. We cannot violate the Noise Margins, otherwise our digital assumption is not valid: thus Vo must be > VOH or < VOL.

Binary Values: Other Physical Quantities
What are other physical quantities represent 0 and 1? Logic Gates, CPU: Voltage Disk CD Dynamic RAM Magnetic Field Direction Surface Pits/Light Electrical Charge

1-2 Number Systems Positive radix, positional number systems Examples:
Decimal (radix r =10) Binary (radix r =2) Octal (radix r = ) Hexadecimal (r = ) Ex: 24.3 = 2x x100+3x10-1 Digits (0-9) Ex: = ( . )10 Bits (0-1) = = 13.25 Digits: 1,2,…9, A, B, C, D, E, F

Exercise (146.A)16 = ( ? )10 (247.4)8 = ( ? )10 =29 + 160 + 12 + 0.5
(247.4)8 = ( ? )10 Other ex: (146.A)16 = 1x x x x16-1 = = (247.4)8 = 2x8^2 + 4x /8 = 2x2^ = = ( )2 = (2AC.8)16 = 2x x x x16-1 = = = Or (2AC.8)16

Powers of 2: 2n It will be convenient to remember these powers n 2n n
1 2 3 4 5 6 7 8 9 10 16 32 64 128 256 512 1024 n 2n -1 -2 -3 0.5 0.25 0.125

Special Powers of 2 220 (=1,048,576) is Mega, denoted "M"
210 (=1024) is Kilo, denoted "K" 220 (=1,048,576) is Mega, denoted "M" 230 (1,073, 741,824) is ? Giga, denoted "G" 240 (1,099,511,627,776 ) is Tera, denoted “T" Note: 8 bits (b) are also called a byte (B) = 2^8-1= 256-1=255 Also what is the max no two bytes can represent? = 2^16-1 = 2^10 x 2^6 – 1 = 1024x64-1=65,536-1=65,535 Exercise: what is ( )2 equal to in decimal? Also what is the maximum number (in decimal) a two bytes long word can represent?

Range of numbers Binary number: ex. a 3-bit number: n=3
000, 001 … ,111 or in decimal system: 0, 1 … 7 Total of 8 numbers (=23) Range: from 0 to 7 (0 to 23-1) In general a n-bit number represents: 2n different numbers Min: 0 Max number: 2n-1 For fractions: m bits after the radix point: Max number: (2m -1)/2m Fractions Max number: ? 2m-1/2m Proof: A A …. A-m2-m) = 2-m (A-12m-1 + A-22m-2 +… A-m20) = 2-m (2m -1)

Exercise 16 Gbyte (= 16 GB) of memory
How many (address) bits are required to address each byte? We need to address or represent 32Giga numbers (address positions): 16Giga = 24 x230=234 or n=34 bits.

Exercise Digital camera has 2048x2048 pixels, and each pixel stores 8 bits of information: a. How many Mega pixels? b. How many bits are stored per frame? c. How many different intensity levels can be represented by each pixel? Solutions: 2048x2048 = 2x1010 x 2x1010 = 4x1020=4Megapixel b. Each pixel stores 8 bits of information; with 4Megapixel there will be 8x4Mbits of information or 32 Mbits or 4Mbyte of information= 32x1024x1024 = 33,554,432 c. With 8 bits per pixel: no. of levels (numbers): 28=256 levels

Use of HEX system Short hand notation of large binary numbers:
Each HEX digits can be represented by exactly 4 bits (16=24) Thus ( )2 Conversion from binary to HEX and HEX to binary is very easy: ( )2 = ( )16 ( )2 = ( )16 B = ( )2 E ( )2 = ( 9D )16 ( )2 = ( )16 = 2 B C B39.7 =

Each octal digit can be represented by 3 bits
Octal system Radix r = 8 8 digits: 0, 1, 2,…7 Ex: 2758 = 2x82 + 7x8 + 5x1 = = 18910 Each octal digit can be represented by 3 bits

1-3 Conversion Between Bases
To convert from one base to another: 1) Convert the Integer Part 2) Convert the Fraction Part 3) Join the two results with a radix point

Conversion from Decimal to new Radix
To Convert the Integral Part: Repeatedly divide the number by the new radix and save the remainders. The digits for the new radix are the remainders in reverse order of their computation. To Convert the Fractional Part: Repeatedly multiply the fraction by the new radix and save the integer digits that result. The digits for the new radix are the integer digits in order of their computation. If the new radix is > 10, then convert all integers > 10 to digits A, B, …

Example: convert (325.65)10 to hex
Integer part: = ( )16 Fractional part: .65 325/16 = 20 and rem = 5 20/16 = 1 and rem = 4 1/ = 0 and rem = 1 Most significant Least significant digit Thus = 14516 0.65x16 = thus int = 10= A 0.4x16 = thus int = 6 Etc. Most significant Least significant Thus = A6616 = 145.A6616

Example: Convert 54.687510 To Base 2
Join the results together with the radix point: 542: 54/2=27 + rem = 0 27/2=13 rem= 1 13/2=6 rem=1 6/2 = 3 rem=0 3/2 = 1 rem=1 ½ = 0 rem =1 Thus 5410 = Answer 1: Converting 46 as integral part: Answer 2: Converting as fractional part: 46/2 = 23 rem = * 2 = int = 1 23/2 = 11 rem = * 2 = int = 0 11/2 = 5 remainder = * 2 = int = 1 5/2 = 2 remainder = * 2 = int = 1 2/2 = 1 remainder = 1/2 = 0 remainder = 1 For fractional part: Reading off in the forward direction: For the integral part: Reading off in the reverse direction: Answer 3: Combining Integral and Fractional Parts:

Conversions from Binary to Octal and Hexadecimal
Grouping in groups of 3 or 4 bits Convert into octal and hexadecimal: Octal: Hexadecimal 8 B16

Octal to Hexadecimal via Binary
Conversion from Octal to Hexadecimal and vice versa Convert 2138 into an hexadecimal number: 2138 8 B16

Exercise: Octal Hexadecimal
Exercise: Hexadecimal to Octal: 3A.5 16 = ( )8 Octal to Binary to Hexadecimal = ( )16 (3A.5) 16 = ( )8 = = (72.24)8 110|011| |111|111 2 Regroup: (1|1001| |1111|1000)2 Convert: D F Answer 2: Marking off in groups of three (four) bits corresponds to dividing or multiplying by 23 = 8 (24 = 16) in the binary system.

Conversion - Summary Hexadecimal Ai.16i Decimal Binary  Ai.8i Octal
Divisions (or x) by 16 Hexadecimal Ai.16i Decimal Divisons by 2 Group in bits of 4 SAi.2i Binary Divisons by 8 Octal Hex: through the binary representation Group in bits of 3  Ai.8i Octal

Single Bit Binary Addition with Carry

Multiple Bit Binary Addition
Extending this to two multiple bit examples: Carries Augend Addend Sum Note: The 0 is the default Carry-In to the least significant bit. Carries Augend Addend Sum

Multiple Bit Binary Subtraction
Extending this to two multiple bit examples: Borrows Minuend Subtrahend Difference Notes: The 0 is a Borrow-In to the least significant bit. If the Subtrahend > the Minuend, interchange and append a – to the result. Borrows Minuend Subtrahend – –10011 Difference

Example: 3-bit code can represent up to 8 different elements”
1-4 Binary Codes A n-bit binary code is a n-bit word which can represent up to 2n different elements. Example: 3-bit code can represent up to 8 different elements” All quantities in a PC needs to be expressed as a binary number: e.g. the digits 0, 1, …9; characters, control characters, etc. This can be done using a “Code

Binary Codes Example: A binary code for the seven colors of the rainbow Code 100 is not used Given n binary digits (called bits), a binary code is a mapping from a set of represented elements to a subset of the 2n binary numbers or elements. Color Binary Number 000 001 010 011 101 110 111 Red Orange Yellow Green Blue Indigo Violet

Binary Coded Decimal (BCD)
The BCD code is the 8,4,2,1 code. This code only encodes the first ten values from 0 to 9. Each decimal digit is coded separately by 4 bits Example: (325)10 = ( )BCD Exercise: (856)10 = ( )BCD (325)10 = BCD If it were a binary conversion (not BCD encoding): (9bits) (856)10 = BCD 856 = ( )2 3 2 5

1-5 ALPHANUMERIC CODES - ASCII Character Codes
American Standard Code for Information Interchange This code is a popular code used to represent information sent as character-based data. It uses 7-bits to represent: 94 Graphic printing characters. 34 Non-printing characters Some non-printing characters are used for text format (e.g. BS = Backspace, CR = carriage return)

ASCII Code: B7B6B5 B4B3B2B1 H=( )

PARITY BIT Error-Detection Codes
Redundancy (e.g. extra information), in the form of extra bits, can be incorporated into binary code words to detect and correct errors. A simple form of redundancy is parity, an extra bit appended onto the code word in the most significant position to make the number of 1’s odd or even. Parity can detect all single-bit errors and some multiple-bit errors. A code word has even parity if the number of 1’s in the code word is even. A code word has odd parity if the number of 1’s in the code word is odd. TX RX 7 Parity bit

ASCII Parity Code Example
TX RX 7 Parity bit At the receiver side: If an even parity is detected, send an ACK control = If error was detected send negative acknowledge NAK = Transmit Ha in ascii: Transmit with even parity: Even Parity Bits: 0, 1, 1, 0, 1, 0, 0, 1 Odd Parity Bits: 1, 0, 0, 1, 0, 1, 1, 0 added parity bit

1-6 GRAY CODE – Decimal Binary Gray 000 001 010 011 100 101 110 111
2 bit changes Only 1 bit changes Answer: As we “counts” up or down in decimal, the code word for the Gray code changes in only one bit position as we go from decimal digit to digit including from 9 to 0.

Download ppt "Digital Computers and Information"

Similar presentations

Ads by Google