Download presentation
Presentation is loading. Please wait.
Published byVanessa Clark Modified over 6 years ago
1
ENG2410 Digital Design “Introduction to Digital Systems”
Fall 2017 S. Areibi School of Engineering University of Guelph
2
Resources Chapter #1, Mano Sections 1.1 Digital Computers
1.2 Number Systems 1.3 Arithmetic Operations 1.4 Decimal Codes 1.5 Alphanumeric Codes School of Engineering
3
Topics Computing Devices and VLSI Design Signals (Digital vs. Analog)
Digital Systems and Computers Number systems [binary, octal, hex] Base Conversion Arithmetic Operations Decimal Codes [BCD] Alphanumeric Codes School of Engineering
4
Digital Systems
5
Computing Devices Everywhere! “Embedded Systems”
PC PDA Home Networking Car Household Super Computer Body Medicine Game console Entertainment Communication What is the main enabler to such digital systems? School of Engineering
6
The Transistor Revolution
Intel 4004 processor Designed in 1971 Almost 3000 transistors Speed:1 MHz operation Bipolar logic 1960’s First transistor Bell Labs, 1948
7
The VLSI Design Cycle Specification Functional design Logic design
Circuit design Physical design Test/Fabrication Logic design SYSTEM + MODULE GATE CIRCUIT n+ S G D DEVICE
8
1.3 VLSI Design Styles Vdd Vdd IN2 IN2 IN1 OUT OUT IN1 GND GND IN1 OUT
Contact Metal layer Vdd IN2 Poly layer IN2 IN1 OUT Diffusion layer OUT IN1 p-type transistor GND n-type transistor GND IN1 OUT IN2 Power (Vdd)-Rail Ground (GND)-Rail
9
Signals
10
Signals An information variable represented by a physical quantity (speech, Temp, humidty, noise, …)
11
Signals Signals can be analog or digital:
Analog signals can have an infinite number of values in a range; Digital signals can have only a limited number of values.
12
Continuous in value & time
Analog Signals Time Analog Continuous in value & time
13
Digital Signals Time Digital
For digital systems, the variable takes on discrete values (i.e., not continuous) Time Digital Discrete in value
14
Signal Examples Over Time
Digital (Binary) values are represented by: digits 0 and 1 / False (F) and True (T) words (symbols) Low (L) and High (H) words On and Off. Time Discrete in value & continuous in time Asynchronous Digital Discrete in value & time Synchronous
15
Binary Values: Other Physical Quantities
What are other physical quantities represent 0 and 1? CPU: Voltage Hard Drive: Magnetic Field Direction CD: Surface Pits/Light Dynamic Ram: Electric Charge
16
A Digital Computer Example
Data/Instructions/code All in clock Inputs: Keyboard, mouse, modem, microphone Outputs: CRT, LCD, modem, speakers Answer: Part of specification for a PC is in MHz. What does that imply? A clock which defines the discrete times for update of state for a synchronous system. Not all of the computer may be synchronous, however. School of Engineering
17
Number Representation
18
Number Systems – Representation
A number with radix r is represented by a string of digits: An - 1An - 2 … A1A0 . A- 1 A- 2 … A- m + 1 A- m in which 0 £ Ai < r and “.” is the radix point. The string of digits represents the power series: ( ) (Number)r = å + j = - m j i i = 0 r A (Integer Portion) (Fraction Portion) i = n - 1 j = - 1
19
Decimal Number System Base (also called radix) = 10 Digit Position
10 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } Digit Position Integer & fraction Formal Notation Digit Weight Weight = (Base) Position Magnitude Sum of “Digit x Weight” 1 -1 2 -2 5 1 2 7 4 (512.74)10 10 1 0.1 100 0.01 500 10 2 0.7 0.04 d2*B2+d1*B1+d0*B0+d-1*B-1+d-2*B-2
20
Octal Number System Base = 8 Weights Formal Notation Magnitude 5 1 2 7
8 digits { 0, 1, 2, 3, 4, 5, 6, 7 } Weights Weight = (Base) Position Formal Notation Magnitude Sum of “Digit x Weight” 1 -1 2 -2 8 1/8 64 1/64 5 1 2 7 4 (512.74)8 5 *8 2+1 *8 1+2 *8 0+7 * *8 -2 =( )10
21
Octal Number System: Example
For Example, (27)8 can be expressed as: ( )10 (17.1)8 can be expressed as: ( )10
22
Hexadecimal Number System
Base = 16 16 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F } Weights Weight = (Base) Position Formal Notation Magnitude Sum of “Digit x Weight” 1 -1 2 -2 16 1/16 256 1/256 1 E 5 7 A (1E5.7A)16 1 * *161+5 *160+7 * *16-2 =( )10
23
Hex to Decimal (2ac)16 2 • 256 + 10 • 16 + 12 • 1 = (684)10
1 2 3 4 5 6 7 8 9 10 a 11 b 12 c 13 d 14 e 15 f Just multiply each hex digit by decimal value, and add the results. (2ac)16 2 • 256 + 10 • 16 + 12 • 1 = (684)10 163 162 161 160 4096 256 16 1
24
Binary Numbers
25
Binary Number System Base = 2 Weights Magnitude Formal Notation
2 digits { 0, 1 }, called binary digits or “bits” Weights Weight = (Base) Position Magnitude Sum of “Bit x Weight” Formal Notation Groups of bits bits = Nibble 8 bits = Byte 1 -1 2 -2 1/2 4 1/4 1 1 1 1 *22+0 *21+1 *20+0 *2-1+1 *2-2 =(5.25)10 (101.01)2
26
Binary Decimal: Example
7 6 5 4 3 2 1 27 26 25 24 23 22 21 20 128 64 32 16 8 position value What is in decimal? 7 6 5 4 3 2 1 position 1 Binary # = (156)10
27
Binary Numbers Strings of binary digits (“bits”) Examples:
(00)2 (0)10 (01)2 (1)10 ( )2 (1)10 (10)2 (2)10 (010)2 (2)10 (11)2 (3)10 (100)2 (4)10 ( )2 Strings of binary digits (“bits”) One bit can store a number from 0 to 1 n bits can store numbers from 0 to 2n-1 School of Engineering
28
Binary Fractions 2i 2i-1 4 2 1 1/2 1/4 1/8 2-j Integer Values
bi bi b2 b1 b b-1 b-2 b-3 … b-j 1/2 Fractional Values 1/4 1/8 2-j decimal number =
29
Example 1 1 x x x x x2-2 6 and 3/4
30
Example 2 0 x x x x x x x2-6 63/64 Note: (1) Numbers of the form …2 are just below 1.0 (2) Short form notation for such numbers is ε
31
Why Binary? This is easier to implement in hardware than a unit that can take on 10 different values. For instance, it can be represented by a transistor being off (0) or on (1). Alternatively, it can be a magnetic stripe that is magnetized with North in one direction (0) or the opposite (1). Binary also has a convenient and natural association with logical values of: False (0) and True (1).
32
The Power of 2 n 2n 20=1 1 21=2 2 22=4 3 23=8 4 24=16 5 25=32 6 26=64 7 27=128 n 2n 8 28=256 9 29=512 10 210=1024 11 211=2048 12 212=4096 20 220=1M 30 230=1G 40 240=1T Kilo Mega Giga Tera
33
Base Conversion
34
Number Base Conversions
Evaluate Magnitude Octal (Base 8) Evaluate Magnitude Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16) Evaluate Magnitude
35
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
36
Decimal to Binary Conversion
37
Decimal (Integer) to Binary Conversion
Divide the number by the ‘Base’ (=2) Take the remainder (either 0 or 1) as a coefficient Take the quotient and repeat the division Example: (13)10 Quotient Remainder Coefficient 13 / 2 = a0 = 1 6 / 2 = a1 = 0 3 / 2 = a2 = 1 1 / 2 = a3 = 1 Answer: (13)10 = (a3 a2 a1 a0)2 = (1101)2 MSB LSB
38
Decimal (Fraction) to Binary Conversion
Multiply the number by the ‘Base’ (=2) Take the integer (either 0 or 1) as a coefficient Take the resultant fraction and repeat multiplication Example: (0.625)10 Integer Fraction Coefficient 0.625 * 2 = a-1 = 1 0.25 * 2 = a-2 = 0 0.5 * 2 = a-3 = 1 Answer: (0.625)10 = (0.a-1 a-2 a-3)2 = (0.101)2 MSB LSB
39
Decimal to Octal Conversion
Example: (175)10 Quotient Remainder Coefficient 175 / 8 = a0 = 7 21 / 8 = a1 = 5 2 / 8 = a2 = 2 Answer: (175)10 = (a2 a1 a0)8 = (257)8 Example: (0.3125)10 Integer Fraction Coefficient 0.3125 * 8 = a-1 = 2 0.5 * 8 = a-2 = 4 Answer: (0.3125)10 = (0.a-1 a-2 a-3)8 = (0.24)8
40
Decimal to Hex c ac 2ac (684)10 684/16 = 42 rem 12=c
1 2 3 4 5 6 7 8 9 10 a 11 b 12 c 13 d 14 e 15 f (684)10 c 684/16 = 42 rem 12=c ac 42/16 = 2 rem 10=a 2/16 = rem 2 2ac 163 162 161 160 4096 256 16 1
41
Hexadecimal (Base 16) Strings of 0’s and 1’s too hard to write
Use base-16 or hexadecimal – 4 bits Dec Bin Hex 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 Dec Bin Hex 8 1000 9 1001 10 1010 a 11 1011 b 12 1100 c 13 1101 d 14 1110 e 15 1111 f Why use base 16? Power of 2 Size of byte
42
Hex to Binary 0x2ac (2ac)16 No magic – remember hex digit = 4 bits
0000 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 1001 9 1010 a 1011 b 1100 c 1101 d 1110 e 1111 f Convention – write 0x (prefix) before number Hex to Binary – just convert digits 0x2ac (2ac)16 0010 1010 1100 0x2ac = ( )2 No magic – remember hex digit = 4 bits
43
Binary − Hexadecimal Conversion
16 = 24 Each group of 4 bits represents a hexadecimal digit Hex Binary 1 2 3 4 5 6 7 8 9 A B C D E F Example: Pad with Zeros ( )2 ( )16 Works both ways (Binary to Hex & Hex to Binary)
44
Binary to Hex Bin Hex 0000 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 1001 9 1010 a 1011 b 1100 c 1101 d 1110 e 1111 f Just convert groups of 4 bits ( )2 0101 0011 0111 1011 5 3 7 b ( )2 = 0x537b = (537b)16
45
Octal − Hexadecimal Conversion
Convert to Binary as an intermediate step Example: ( )8 Assume Zeros Assume Zeros ( )2 ( )16 Works both ways (Octal to Hex & Hex to Octal)
46
Binary Arithmetic
47
Princess Sumaya University
Addition Digital Logic Design Decimal Addition 1 1 Carry 5 5 + 5 5 1 1 = Ten ≥ Base Subtract a Base Dr. Bassam Kahhaleh
48
Binary Addition Adding bits: Adding integers: carry carry 1 1
0 + 0 = 0 + 1 = 1 + 0 = 1 + 1 = (1) 0 = (1) 1 Adding integers: carry carry 1 1 (1)2 = (7)10 (0)2 = (6)10 (0) (1)2 = = (13)10 (1)1 (1)0
49
Princess Sumaya University
Binary Addition Digital Logic Design Column Addition 1 1 1 1 1 1 1 1 1 1 1 = (61)10 = (23)10 + 1 1 1 1 = (84)10 1 1 1 ≥ (2)10 Dr. Bassam Kahhaleh
50
Binary Codes
51
Binary Numbers and Binary Coding
Flexibility of representation Within constraints below, can assign any binary combination (called a code word) to any data as long as data is uniquely encoded. Information Types Numeric Must represent range of data needed Very desirable to represent data such that simple, straightforward computation for common arithmetic operations permitted Tight relation to binary numbers Non-numeric Greater flexibility since arithmetic operations not applied. Not tied to binary numbers
52
Non-numeric Binary Codes
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. Example: A binary code for the seven colors of the rainbow Code 100 is not used Binary Number 000 001 010 011 101 110 111 Color Red Orange Yellow Green Blue Indigo Violet
53
Number of Bits Required
Given M elements to be represented by a binary code, the minimum number of bits, n, needed, satisfies the following relationships: 2n > M > 2(n – 1) n = log2 M where x , is called the ceiling function, i.e the integer greater than or equal to x. M = 10 Therefore n = 4 since: 24 =16 is 10 > 23 = 8 and the ceiling function for log2 10 is 4. School of Engineering
54
Number of Bits Required
Given M elements to be represented by a binary code, the minimum number of bits, n, needed, satisfies the following relationships: Example: How many bits are required to represent decimal digits with a binary code? M = 10, hence n = ceiling (log2 10) = ceiling (3.3219) = 4 Checking: M = 10 Therefore n = 4 since: 24 =16 is 10 > 23 = 8 and the ceiling function for log2 10 is 4.
55
Binary Codes Group of n bits Binary Coded Decimal (BCD)
Up to 2n combinations Each combination represents an element of information Binary Coded Decimal (BCD) Each Decimal Digit is represented by 4 bits (0 – 9) Valid combinations (10 – 15) Invalid combinations Decimal BCD 1 2 3 4 5 6 7 8 9
56
Gray Code One bit changes from one code to the next code
Different than Binary Decimal Gray 00 0000 01 0001 02 0011 03 0010 04 0110 05 0111 06 0101 07 0100 08 1100 09 1101 10 1111 11 1110 12 1010 13 1011 14 1001 15 1000 Binary 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
57
Binary Representations
A bit is the most basic unit of information in a computer. It is a state of “on” or “off” in a digital circuit. Sometimes these states are “high” or “low” voltage instead of “on” or “off..” A group of four bits is called a nibble (or nybble). Bytes, therefore, consist of two nibbles: a “high-order nibble,” and a “low-order” nibble. A byte is a group of eight bits. A byte is the smallest possible addressable (can be found via its location) unit of computer storage. A word is a contiguous group of bytes. Words can be any number of bits (16, 32, 64 bits are common).
58
Advantages/Disadvantages?
Conversion or Coding? Do NOT mix up conversion of a decimal number to a binary number with coding a decimal number with a BINARY CODE. (13)10 = (1101)2 (This is conversion) (13)BCD (0001|0011)BCD (This is coding) Advantages/Disadvantages?
59
BCD: Advantages/Disadvantages
It is obvious that a BCD number needs more bits than its equivalent binary value (26)10 = (11010)2 (26)10 = ( )BCD Advantages: Computer input/output data are handled by people who use the decimal system. So it is easier to convert back/forth to BCD.
60
ASCII Codes
61
Character Codes From numbers to letters ASCII Unicode
Stands for American Standard Code for Information Interchange Only 7 bits defined Unicode
62
ASCII Code American Standard Code for Information Interchange Info
7-bit Code A B . Z a b z @ ? +
63
ASCII table
64
Reading Read Chapter 1 Check the lecture notes from the Web site.
Make sure you’re comfortable with material Check the lecture notes from the Web site. Solve the assignment.
65
Homework See Assignment #1 On Web
I expect you to know number systems well and be able to do conversions and arithmetic Decimal – Binary Binary – Decimal Decimal – Hex Hex – Decimal Will be on test!
66
End Slides
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.