ENG2410 Digital Design “Introduction to Digital Systems”

Slides:



Advertisements
Similar presentations
Number Systems and Codes
Advertisements

Princess Sumaya Univ. Computer Engineering Dept. د. بســام كحـالــه Dr. Bassam Kahhaleh.
Chapter 1 Digital Systems and Numbers System
SYEN 3330 Digital Systems Jung H. Kim Chapter 1 1 SYEN 3330 Digital Systems Chapter 1.
Overview Digital Systems, Computers, and Beyond
Digital Computers and Information
Information Representation and Number Systems BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
Introduction to Digital Logic Design
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
Programmable Logic Controllers
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 1 – Digital Systems and Information Logic.
CSC212 – Computer Organization and Design
Logic and Digital System Design - CS 303
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 2 Number.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
Number systems & Binary codes MODULE 1 Digital Logic Design Ch1-2 Outline of Chapter 1  1.1 Digital Systems  1.2 Binary Numbers  1.3 Number-base Conversions.
CE1111 :Digital Logic Design lecture 01 Introduction Dr. Atef Ali Ibrahim.
ENG241 Digital Design Week #1 Digital Computers and Information.
Dr. Ahmed Telba EE208: Logic Design Lecture# 1 Introduction & Number Systems.
1 Dr. Mohamed Abdur Rahman Office hours Sunday: 10:00- 12:00 & Tuesday: 3:00 - 3:50 Course website: Has been created
Data Representation, Number Systems and Base Conversions
AEEE2031 Data Representation and Numbering Systems.
Digital Systems and Binary Numbers
Number Systems by Dr. Amin Danial Asham. References  Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
Chapter 1 Digital Systems and Binary Numbers
ECE/CS 352 Digital System Fundamentals© T. Kaminski & C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapter 1 Tom Kaminski & Charles R.
Chapter 1: Binary Systems
Chapter 1 : Introduction to Binary Systems 1.1. Introduction to Digital Systems 1.2. Binary Numbers 1.3. Number Base Conversion 1.4. Octal and Hexadecimal.
Overview 1-1 Information Representation
1 Digital Logic Design Engr. Kashif Shahzad. 2 What’s Course About?  Digital logic, focusing on the design of computers  Stay above transistor level.
CS151 Introduction to Digital Design Chapter 1: Digital Systems and Information Lecture 2 1Created by: Ms.Amany AlSaleh.
BINARY SYSTEMS ENGR. KASHIF SHAHZAD 1. BINARY NUMBERS 1/2 Internally, information in digital systems is of binary form groups of bits (i.e. binary numbers)
Digital Logic Design Ch1-1 Chapter 1 Digital Systems and Binary Numbers Mustafa Kemal Uyguroğlu Digital Logic Design I.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Digital logic COMP214  Lecture 2 Dr. Sarah M.Eljack Chapter 1 1.
Digital logic COMP214  Lecture 1 Dr. Sarah M.Eljack Chapter 1 1.
Logic and Computer Design Fundamentals
Unit 1 Introduction Number Systems and Conversion.
Chapter 1 Digital Systems and Binary Numbers
Number Systems and Codes
Digital Logic and Design
Digital Systems and Binary Numbers
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CHAPTER 1 : INTRODUCTION
Introduction to Chapter 2
Digital Electronics Jess 2008.
Digital Systems and Binary Numbers
Introduction The term digital is derived from the way computers perform operation, by counting digits. Application of digital technology: television, communication.
Chapter 3 Data Representation
Chapter 1 Digital Systems and Binary Numbers
University of Gujrat Department of Computer Science
2 Number Systems and Codes Edited by Jerry Bernardini.
SYEN 3330 Digital Systems Chapter 1 SYEN 3330 Digital Systems.
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
INTRODUCTION TO LOGIC DESIGN Chapter 1 Digital Systems and Binary Numbers gürtaçyemişçioğlu.
Number Systems and Codes
Overview Digital Systems and Computer Systems
Some Information Instructor Details Main Book. Some Information Instructor Details Main Book.
Overview Digital Systems and Computer Systems
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Digital Systems and Binary Numbers
Chapter Four Data Representation in Computers By Bezawit E.
UNIT – 3 & 4. Data Representation and Internal
ENEL 111 Digital Electronics
CHAPTER 69 NUMBER SYSTEMS AND CODES
Presentation transcript:

ENG2410 Digital Design “Introduction to Digital Systems” Fall 2017 S. Areibi School of Engineering University of Guelph

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

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

Digital Systems

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

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

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

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

Signals

Signals An information variable represented by a physical quantity (speech, Temp, humidty, noise, …)

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.

Continuous in value & time Analog Signals Time Analog Continuous in value & time

Digital Signals Time Digital For digital systems, the variable takes on discrete values (i.e., not continuous) Time Digital Discrete in value

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

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

A Digital Computer Example Data/Instructions/code All in 01010010010 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

Number Representation

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

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

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- 1+4 *8 -2 =(330.9375)10

Octal Number System: Example For Example, (27)8 can be expressed as: ( )10 (17.1)8 can be expressed as: ( )10

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 *162+14 *161+5 *160+7 *16-1+10 *16-2 =(485.4765625)10

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

Binary Numbers

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 4 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 1 0 1 1 1 1 0 0 0 1 0 1

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 10011100 in decimal? 7 6 5 4 3 2 1 position 1 Binary # 128 + 0 + 0 + 16 + 8 + 4 + 0 + 0 = (156)10

Binary Numbers Strings of binary digits (“bits”) Examples: (00)2  (0)10 (01)2  (1)10 (0000001)2  (1)10 (10)2  (2)10 (010)2  (2)10 (11)2  (3)10 (100)2  (4)10 (1001010101000)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

Binary Fractions 2i 2i-1 4 2 1 1/2 1/4 1/8 2-j Integer Values bi bi-1 . . . b2 b1 b0 b-1 b-2 b-3 … b-j 1/2 Fractional Values 1/4 1/8 2-j decimal number =

Example 1 1 1 0 . 1 12 1 x 22 + 1 x 21 + 0x20 + 1x2-1 + 1x2-2 6 and 3/4

Example 2 0 . 1 1 1 1 1 12 0 x 20 + 1 x 2-1 + 1x2-2 + 1x2-3 + 1x2-4 + 1x2-5 + 1x2-6 63/64 Note: (1) Numbers of the form 0.11111…2 are just below 1.0 (2) Short form notation for such numbers is 1.0 - ε

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).

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

Base Conversion

Number Base Conversions Evaluate Magnitude Octal (Base 8) Evaluate Magnitude Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16) Evaluate Magnitude

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

Decimal to Binary Conversion

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 = 6 1 a0 = 1 6 / 2 = 3 0 a1 = 0 3 / 2 = 1 1 a2 = 1 1 / 2 = 0 1 a3 = 1 Answer: (13)10 = (a3 a2 a1 a0)2 = (1101)2 MSB LSB

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 = 1 . 25 a-1 = 1 0.25 * 2 = 0 . 5 a-2 = 0 0.5 * 2 = 1 . 0 a-3 = 1 Answer: (0.625)10 = (0.a-1 a-2 a-3)2 = (0.101)2 MSB LSB

Decimal to Octal Conversion Example: (175)10 Quotient Remainder Coefficient 175 / 8 = 21 7 a0 = 7 21 / 8 = 2 5 a1 = 5 2 / 8 = 0 2 a2 = 2 Answer: (175)10 = (a2 a1 a0)8 = (257)8 Example: (0.3125)10 Integer Fraction Coefficient 0.3125 * 8 = 2 . 5 a-1 = 2 0.5 * 8 = 4 . 0 a-2 = 4 Answer: (0.3125)10 = (0.a-1 a-2 a-3)8 = (0.24)8

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 = 0 rem 2 2ac  163 162 161 160 4096 256 16 1

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

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 = (001010101100)2 No magic – remember hex digit = 4 bits

Binary − Hexadecimal Conversion 16 = 24 Each group of 4 bits represents a hexadecimal digit Hex Binary 0 0 0 0 1 0 0 0 1 2 0 0 1 0 3 0 0 1 1 4 0 1 0 0 5 0 1 0 1 6 0 1 1 0 7 0 1 1 1 8 1 0 0 0 9 1 0 0 1 A 1 0 1 0 B 1 0 1 1 C 1 1 0 0 D 1 1 0 1 E 1 1 1 0 F 1 1 1 1 Example: Pad with Zeros ( 1 0 1 1 0 . 0 1 )2 ( 1 6 . 4 )16 Works both ways (Binary to Hex & Hex to Binary)

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 (101001101111011)2 0101  0011  0111  1011 5 3 7 b (101001101111011)2 = 0x537b = (537b)16

Octal − Hexadecimal Conversion Convert to Binary as an intermediate step Example: ( 2 6 . 2 )8 Assume Zeros Assume Zeros ( 0 1 0 1 1 0 . 0 1 0 )2 ( 1 6 . 4 )16 Works both ways (Octal to Hex & Hex to Octal)

Binary Arithmetic

Princess Sumaya University Addition 4241 - Digital Logic Design Decimal Addition 1 1 Carry 5 5 + 5 5 1 1 = Ten ≥ Base  Subtract a Base Dr. Bassam Kahhaleh

Binary Addition Adding bits: Adding integers: carry carry 1 1 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = (1) 0 1 + 1 + 1 = (1) 1 Adding integers: carry carry 1 1 0 0 0 . . . . . . 0 1 1 (1)2 = (7)10 + 0 0 0 . . . . . . 0 1 1 (0)2 = (6)10 (0) (1)2 = = (13)10 0 0 0 . . . . . 1 (1)1 (1)0

Princess Sumaya University Binary Addition 4241 - 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

Binary Codes

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

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

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

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.

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 0 0 0 0 1 0 0 0 1 2 0 0 1 0 3 0 0 1 1 4 0 1 0 0 5 0 1 0 1 6 0 1 1 0 7 0 1 1 1 8 1 0 0 0 9 1 0 0 1

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

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).

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?

BCD: Advantages/Disadvantages It is obvious that a BCD number needs more bits than its equivalent binary value (26)10 = (11010)2 (26)10 = (0010 0110)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.

ASCII Codes

Character Codes From numbers to letters ASCII Unicode Stands for American Standard Code for Information Interchange Only 7 bits defined Unicode

ASCII Code American Standard Code for Information Interchange Info 7-bit Code A 1000001 B 1000010 . Z 1011010 a 1100001 b 1100010 z 1111010 @ 1000000 ? 0111111 + 0101011

ASCII table

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.

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!

End Slides