Digital Systems Digital Logic and Design Dr. Musab Bassam Zghool Text Book: Mano Morris M. “ Digital Logic And Computer Design ”

Slides:



Advertisements
Similar presentations
Appendix 1 Number Systems Objectives: Review of number systems and radix conversion methods Review of binary, octal, hexadecimal and BCD unsigned codes.
Advertisements

Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
DATA REPRESENTATION CONVERSION.
Chapter 1 Binary Systems 1-1. Digital Systems
Level ISA3: Information Representation
Number Systems. 2 The total number of allowable symbols in a number system is called the radix or base of the system. Decimal Numbers: radix = 10 (symbols:
King Fahd University of Petroleum and Minerals
Data Representation ICS 233
Overview Digital Systems, Computers, and Beyond
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
1 Number Systems. 2 Numbers Each number system is associated with a base or radix – The decimal number system is said to be of base or radix 10 A number.
Number Systems and Arithmetic
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.
Computers Organization & Assembly Language
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
Numbering Systems CS208.
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.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
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.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Lecture 4 Last Lecture –Positional Numbering Systems –Converting Between Bases Today’s Topics –Signed Integer Representation Signed magnitude One’s complement.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
Number systems, Operations, and Codes
Number Base Conversions
Data Representation, Number Systems and Base Conversions
AEEE2031 Data Representation and Numbering Systems.
Chapter 1: Binary Systems
CPEN Digital Logic Design Binary Systems Spring 2004 C. Gerousis © Digital Design 3 rd Ed., Mano Prentice Hall.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Positive Integers Dale Roberts,
Overview 1-1 Information Representation
ECE DIGITAL LOGIC LECTURE 2: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/14/2016.
Data Representation COE 301 Computer Organization Dr. Muhamed Mudawar
Chapter 1 – Digital Systems and Information Logic and Computer Design Fundamentals.
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.
Data Representation COE 301 Computer Organization Prof. Muhamed Mudawar College of Computer Sciences and Engineering King Fahd University of Petroleum.
1 Digital Logic Design (41-135) Chapter 5 Number Representation & Arithmetic Circuits Younglok Kim Dept. of Electrical Engineering Sogang University Spring.
Dr. Nermin Hamza 1. Materials Book: Digital Design 4 th M. Morris Mano and Michael D. Ciletti 2.
Chapter 1 Digital Systems and Binary Numbers
Data Representation COE 308 Computer Architecture
Positional Number Systems Decimal, Binary, Octal and Hexadecimal Numbers Wakerly Section
Data Representation ICS 233
Lec 3: Data Representation
Data Representation.
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CHAPTER 1 : INTRODUCTION
Number Systems.
Number System conversions
Fundamentals & Ethics of Information Systems IS 201
Data Representation COE 301 Computer Organization
Number Systems and Codes
Digital Electronics & Logic Design
Dr. Clincy Professor of CS
Data Representation in Computer Systems
Numbering System TODAY AND TOMORROW 11th Edition
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Digital Electronics and Microprocessors
Digital Systems and Binary Numbers
Number Systems Rayat Shikshan Sanstha’s
Data Representation ICS 233
Number Systems Rayat Shikshan Sanstha’s
Information Representation
Data Representation COE 308 Computer Architecture
Presentation transcript:

Digital Systems Digital Logic and Design Dr. Musab Bassam Zghool Text Book: Mano Morris M. “ Digital Logic And Computer Design ”

Digital Systems© Umm Al-Qura – slide 2 Is it Worth the Effort?  Absolutely!  Digital circuits are employed in the design of:  Digital computers  Data communication  Digital phones  Digital cameras  Digital TVs, etc.  This course presents the basic tools for the design of digital circuits and provides the fundamental concepts used in the design of digital systems

Digital Systems© Umm Al-Qura – slide 3 Block Diagram of Digital Computer

Digital Systems© Umm Al-Qura – slide 4 Digitization of Analog Signals – cont’d  Some loss of accuracy, why?  How to improve accuracy? Voltage Time Voltage Time Add more voltage values

Digital Systems© Umm Al-Qura – slide 5 ADC and DAC Converters  Analog-to-Digital Converter (ADC)  Produces digitized version of analog signals  Analog input => Digital output  Digital-to-Analog Converter (DAC)  Regenerate analog signal from digital form  Digital input => Analog output  Our focus is on digital systems only  Both input and output to a digital system are digital signals Analog-to-Digital Converter (ADC) Digital-to-Analog Converter (DAC) Digital System input digital signals output digital signals input analog signals output analog signals

Digital Systems© Umm Al-Qura – slide 6 Binary Numbers  Each binary digit (called a bit) is either 1 or 0  Bits have no inherent meaning, they can represent …  Unsigned and signed integers  Fractions  Characters  Images, sound, etc.  Bit Numbering  Least significant bit (LSB) is rightmost (bit 0)  Most significant bit (MSB) is leftmost (bit 7 in an 8-bit number) Most Significant Bit Least Significant Bit

Digital Systems© Umm Al-Qura – slide 7 Decimal Value of Binary Numbers  Each bit represents a power of 2  Every binary number is a sum of powers of 2  Decimal Value = (d n-1  2 n-1 ) (d 1  2 1 ) + (d 0  2 0 )  Binary ( ) 2 = Some common powers of = 157

Digital Systems© Umm Al-Qura – slide 8 Different Representations of Natural Numbers XXVIIRoman numerals (not positional) 27Radix-10 or decimal number (positional) Radix-2 or binary number (also positional) Fixed-radix positional representation with n digits Number N in radix r = (d n–1 d n–2... d 1 d 0 ) r N r Value = d n–1 ×r n–1 + d n–2 ×r n–2 + … + d 1 ×r + d 0 Examples:(11011) 2 = (2107) 8 = Positional Number Systems 1× × × ×2 + 1 = 27 2× × ×8 + 7 = 1095

Digital Systems© Umm Al-Qura – slide 9 Convert Decimal to Binary  Repeatedly divide the decimal integer by 2  Each remainder is a binary digit in the translated value  Example: Convert to Binary 37 = (100101) 2 least significant bit most significant bit stop when quotient is zero

Digital Systems© Umm Al-Qura – slide 10 Popular Number Systems  Binary Number System: Radix = 2  Only two digit values: 0 and 1  Numbers are represented as 0s and 1s  Octal Number System: Radix = 8  Eight digit values: 0, 1, 2, …, 7  Decimal Number System: Radix = 10  Ten digit values: 0, 1, 2, …, 9  Hexadecimal Number Systems: Radix = 16  Sixteen digit values: 0, 1, 2, …, 9, A, B, …, F  A = 10, B = 11, …, F = 15  Octal and Hexadecimal numbers can be converted easily to Binary and vice versa

Digital Systems© Umm Al-Qura – slide 11 Octal and Hexadecimal Numbers  Octal = Radix 8  Only eight digits: 0 to 7  Digits 8 and 9 not used  Hexadecimal = Radix 16  16 digits: 0 to 9, A to F  A=10, B=11, …, F=15  First 16 decimal values (0 to15) and their values in binary, octal and hex. Memorize table Decimal Radix 10 Binary Radix 2 Octal Radix 8 Hex Radix A B C D E F

Digital Systems© Umm Al-Qura – slide 12 Binary, Octal, and Hexadecimal  Binary, Octal, and Hexadecimal are related: Radix 16 = 2 4 and Radix 8 = 2 3  Hexadecimal digit = 4 bits and Octal digit = 3 bits  Starting from least-significant bit, group each 4 bits into a hex digit or each 3 bits into an octal digit  Example: Convert 32-bit number into octal and hex 497A61 B E Hexadecimal 32-bit binary Octal

Digital Systems© Umm Al-Qura – slide 13  Octal to Decimal: N 8 = (d n-1  8 n-1 ) (d 1  8) + d 0  Hex to Decimal: N 16 = (d n-1  16 n-1 ) (d 1  16) + d 0  Examples: (7204) 8 = (7  8 3 ) + (2  8 2 ) + (0  8) + 4 = 3716 (3BA4) 16 = (3  16 3 ) + (11  16 2 ) + (10  16) + 4 = Converting Octal & Hex to Decimal

Digital Systems© Umm Al-Qura – slide 14 Converting Decimal to Hexadecimal 422 = (1A6) 16 stop when quotient is zero least significant digit most significant digit  Repeatedly divide the decimal integer by 16  Each remainder is a hex digit in the translated value  Example: convert 422 to hexadecimal  To convert decimal to octal divide by 8 instead of 16

Digital Systems© Umm Al-Qura – slide 15 Important Properties – cont’d  How many possible values can be represented … Using n binary digits? Using n octal digits Using n decimal digits? Using n hexadecimal digits Using n digits in Radix r ? 2 n values: 0 to 2 n – 1 10 n values: 0 to 10 n – 1 r n values: 0 to r n – 1 8 n values: 0 to 8 n – 1 16 n values: 0 to 16 n – 1

Digital Systems© Umm Al-Qura – slide 16 Representing Fractions  A number N r in radix r can also have a fraction part: N r = d n-1 d n-2 … d 1 d 0. d -1 d -2 … d -m  1 d -m  The number N r represents the value: N r =d n-1 × r n-1 + … + d 1 × r + d 0 + (Integer Part) d -1 × r -1 + d -2 × r -2 … + d -m × r –m (Fraction Part) Integer PartFraction Part 0 ≤ d i < r Radix Point N r =  + j = -mi = 0 d i × r i i = n-1 j = -1 d j × r j

Digital Systems© Umm Al-Qura – slide 17 Examples of Numbers with Fractions  ( ) 10  ( ) 2  (703.64) 8  (A1F.8) 16  (423.1) 5  (263.5) 6 = 2× × × ×10 -2 = = = 7× × ×8 -2 = = 10× ×16 -1 = = 4× × = Digit 6 is NOT allowed in radix 6

Digital Systems© Umm Al-Qura – slide 18 Converting Decimal Fraction to Binary  Convert N = to Radix 2  Solution: Multiply N by 2 repeatedly & collect integer bits  Stop when new fraction = 0.0, or when enough fraction bits are obtained  Therefore, N = = (0.1011) 2  Check (0.1011) 2 = = MultiplicationNew FractionBit × 2 = × 2 = × 2 = × 2 = First fraction bit Last fraction bit

Digital Systems© Umm Al-Qura – slide 19 More Conversion Examples  Convert N = to Octal (Radix 8)  Solution: N = (split integer from fraction)  The integer and fraction parts are converted separately  Therefore, 139 = (213) 8 and = (0.54) 8  Now, join the integer and fraction parts with radix point N = = (213.54) 8 MultiplicationNew FractionDigit × 8 = × 8 = DivisionQuotientRemainder 139 / / / 802

Digital Systems© Umm Al-Qura – slide 20 Simplified Conversions  Converting fractions between Binary, Octal, and Hexadecimal can be simplified  Starting at the radix pointing, the integer part is converted from right to left and the fractional part is converted from left to right  Group 4 bits into a hex digit or 3 bits into an octal digit  Use binary to convert between octal and hexadecimal AC Binary Hexadecimal B. 8 Octal 3. fraction: left to rightinteger: right to left

Digital Systems© Umm Al-Qura – slide 21 Decimal Codes  Binary number system is most natural for computers  But people are used to the decimal system  Must convert decimal numbers to binary, do arithmetic on binary numbers, then convert back to decimal  To simplify conversions, decimal codes can be used  Define a binary code for each decimal digit  Since 10 decimal digits exit, a 4-bit code is used  But a 4-bit code gives 16 unique combinations  10 combinations are used and 6 will be unused

Digital Systems© Umm Al-Qura – slide 22 Binary Coded Decimal (BCD)  Simplest binary code for decimal digits  Only encodes ten digits from 0 to 9  BCD is a weighted code  The weights are 8,4,2,1  Same weights as a binary number  There are six invalid code words 1010, 1011, 1100, 1101, 1110, 1111  Example on BCD coding: 13  ( ) BCD DecimalBCD

Digital Systems© Umm Al-Qura – slide 23 Warning: 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  = (1101) 2 This is conversion  13  ( ) BCD This is coding  In general, coding requires more bits than conversion  A number with n decimal digits is coded with 4n bits in BCD

Digital Systems© Umm Al-Qura – slide 24 Other Decimal Codes  Many ways to assign 4-bit code to 10 decimal digits  Each code uses only 10 combinations out of 16  BCD and 8, 4, -2, -1 are weighted codes  Excess-3 and 8,4,-2,-1 are self-complementing codes  Note that BCD is NOT self-complementing DecimalBCDExcess-38,4,-2,

Digital Systems© Umm Al-Qura – slide 25 Printable ASCII Codes ABCDEF 2 space !"#$%&'()*+,-./ :;<=>? 5 PQRSTUVWXYZ[\]^_ 6 `abcdefghijklmno 7 pqrstuvwxyz{|}~ DEL  Examples:  ASCII code for space character = 20 (hex) = 32 (decimal)  ASCII code for 'L' = 4C (hex) = 76 (decimal)  ASCII code for 'a' = 61 (hex) = 97 (decimal)