A digital system is a system that manipulates discrete elements of information represented internally in binary form. Digital computers –general purposes.

Slides:



Advertisements
Similar presentations
A digital system is a system that manipulates discrete elements of information represented internally in binary form. Digital computers –general purposes.
Advertisements

Chapter 1 Digital Systems and Numbers System
Chapter 1 Binary Systems 1-1. Digital Systems
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Overview Digital Systems, Computers, and Beyond
SYEN 3330 Digital Systems Jung H. Kim Chapter 1 1 SYEN 3330 Digital Systems Chapter 1.
Overview Digital Systems, Computers, and Beyond
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 Computers and Information
Information Representation and Number Systems BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
Mantıksal Tasarım – BBM231 M. Önder Efe
1.6 Signed Binary Numbers.
Introduction to Digital Logic Design
Digital Systems and Binary Numbers
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Chapter 1 1 CPE 231 Digital Logic Introduction Dr. Gheith Abandah [Adapted from the slides of the textbook of Mano and Kime]
Chapter 1 Digital Systems and Binary Numbers
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.
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
Chapter 1 1 CPE 231 Digital Logic Introduction Dr. Gheith Abandah [Adapted from the slides of the textbook of Mano and Kime]
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.
1.7 BINARY CODES BCD Code (Binary –Coded Decimal ) BCD Addition
Based on slides by:Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. ECE/CS 352: Digital System Fundamentals Lecture 2 – Binary Codes.
CS151 Introduction to Digital Design
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.
CE1111 :Digital Logic Design lecture 01 Introduction Dr. Atef Ali Ibrahim.
1.8 Binary Storage and Registers
AEEE2031 Data Representation and Numbering Systems.
Digital Systems and Binary Numbers
Digital Circuits Text Book –M. M. Mano, "Digital Design," 3rd Ed., Prentice Hall Inc., Reference –class notes Grade –quizzes:15% –mid-term:27.5%
Signed Binary Numbers Arithmetic Subtraction – In 2’s-complement form: Example: 1.Take the 2’s complement of the subtrahend (including the sign bit) and.
Chapter 1 Digital Systems and Binary Numbers
1 CHAPTER 1 DIGITAL SYSTEMS AND BINARY NUMBERS 2 O UTLINE OF C HAPTER Digital Systems 1.2 Binary Numbers 1.3 Number-base Conversions 1.4 Octal.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
MECH1500 Chapter 3.
D IGITAL C IRCUITS Book Title: Digital Design Edition: Fourth Author: M. Morris Mano 1.
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
CPEN Digital Logic Design Binary Systems Spring 2004 C. Gerousis © Digital Design 3 rd Ed., Mano Prentice Hall.
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.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 1 – Digital Systems and Information Logic.
Overview 1-1 Information Representation
ECE DIGITAL LOGIC LECTURE 4: BINARY CODES Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/26/2016.
Lecture 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy
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.
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.
Number Systems By, B. R. Chandavarkar CSE Dept., NITK, Surathkal.
Chapter 1 Digital Systems and Binary Numbers
Logic and Computer Design Fundamentals
Digital Logic and Design
Digital Systems and Binary Numbers
CHAPTER 1 : INTRODUCTION
Digital Systems and Binary Numbers
Chapter 1 Digital Systems and Binary Numbers
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.
Overview Digital Systems and Computer Systems
Overview Digital Systems and Computer Systems
Digital Systems and Binary Numbers
Presentation transcript:

A digital system is a system that manipulates discrete elements of information represented internally in binary form. Digital computers –general purposes –many scientific, industrial and commercial applications Digital systems –telephone switching exchanges –digital camera –electronic calculators, PDA's –digital TV Chapter 1: Digital Systems and Binary Numbers

Signal An information variable represented by physical quantity For digital systems, the variable takes on discrete values –Two level, or binary values are the most prevalent values 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 On and Off. Binary values are represented by values or ranges of values of physical quantities

Binary Numbers Decimal number … a 5 a 4 a 3 a 2 a 1.a  1 a  2 a  3 … Decimal point Example: Base or radix Power General form of base-r system Coefficient: a j = 0 to r  1

Binary Numbers Example: Base-2 number Example: Base-5 number Example: Base-8 number Example: Base-16 number

Binary Numbers Example: Base-2 number Special Powers of 2  2 10 (1024) is Kilo, denoted "K"  2 20 (1,048,576) is Mega, denoted "M"  2 30 (1,073, 741,824)is Giga, denoted "G" Powers of two Table 1.1

Arithmetic operation Arithmetic operations with numbers in base r follow the same rules as decimal numbers.

Binary Arithmetic Single Bit Addition with Carry Multiple Bit Addition Single Bit Subtraction with Borrow Multiple Bit Subtraction Multiplication BCD Addition

Binary Arithmetic Addition Augend: Addend: Sum: Subtraction Minuend: Subtrahend:  Difference: Multiplication

Number-Base Conversions Name Radix Digits Binary 2 0,1 Octal 8 0,1,2,3,4,5,6,7 Decimal 10 0,1,2,3,4,5,6,7,8,9 Hexadecimal 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F  The six letters (in addition to the 10 integers) in hexadecimal represent: 10, 11, 12, 13, 14, and 15, respectively.

Number-Base Conversions Example1.1 Convert decimal 41 to binary. The process is continued until the integer quotient becomes 0.

Number-Base Conversions  The arithmetic process can be manipulated more conveniently as follows:

Number-Base Conversions Example 1.2 Convert decimal 153 to octal. The required base r is 8. Example1.3 Convert (0.6875) 10 to binary. The process is continued until the fraction becomes 0 or until the number of digits has sufficient accuracy.

Number-Base Conversions Example1.3  To convert a decimal fraction to a number expressed in base r, a similar procedure is used. However, multiplication is by r instead of 2, and the coefficients found from the integers may range in value from 0 to r  1 instead of 0 and 1.

Number-Base Conversions Example1.4 Convert (0.513) 10 to octal.  From Examples 1.1 and 1.3: ( ) 10 = ( ) 2  From Examples 1.2 and 1.4: ( ) 10 = ( ) 8

Octal and Hexadecimal Numbers  Numbers with different bases: Table 1.2.

Octal and Hexadecimal Numbers  Conversion from binary to octal can be done by positioning the binary number into groups of three digits each, starting from the binary point and proceeding to the left and to the right.  Conversion from binary to hexadecimal is similar, except that the binary number is divided into groups of four digits:  Conversion from octal or hexadecimal to binary is done by reversing the preceding procedure.

Complements  There are two types of complements for each base-r system: the radix complement and diminished radix complement. the r's complement and the second as the (r  1)'s complement. ■ Diminished Radix Complement Example:  For binary numbers, r = 2 and r – 1 = 1, so the 1's complement of N is (2 n  1) – N. Example:

Complements ■ Radix Complement The r's complement of an n-digit number N in base r is defined as r n – N for N ≠ 0 and as 0 for N = 0. Comparing with the (r  1) 's complement, we note that the r's complement is obtained by adding 1 to the (r  1) 's complement, since r n – N = [(r n  1) – N] + 1. Example: Base-10 The 10's complement of is The 10's complement of is Example: Base-2 The 2's complement of is The 2's complement of is

Complements ■ Subtraction with Complements The subtraction of two n-digit unsigned numbers M – N in base r can be done as follows:

Complements Example 1.5 Using 10's complement, subtract – Example 1.6 Using 10's complement, subtract 3250 – There is no end carry. Therefore, the answer is – (10's complement of 30718) = 

Complements Example 1.7 Given the two binary numbers X = and Y = , perform the subtraction (a) X – Y and (b) Y  X by using 2's complement. There is no end carry. Therefore, the answer is Y – X =  (2's complement of ) = 

Complements  Subtraction of unsigned numbers can also be done by means of the (r  1)'s complement. Remember that the (r  1) 's complement is one less then the r's complement. Example 1.8 Repeat Example 1.7, but this time using 1's complement. There is no end carry, Therefore, the answer is Y – X =  (1's complement of ) = 

Signed Binary Numbers  To represent negative integers, we need a notation for negative values.  It is customary to represent the sign with a bit placed in the leftmost position of the number.  The convention is to make the sign bit 0 for positive and 1 for negative. Example:  Table 1.3 lists all possible four-bit signed binary numbers in the three representations.

Signed Binary Numbers

■ Arithmetic Addition The addition of two numbers in the signed-magnitude system follows the rules of ordinary arithmetic. If the signs are the same, we add the two magnitudes and give the sum the common sign. If the signs are different, we subtract the smaller magnitude from the larger and give the difference the sign of the larger magnitude.  The addition of two signed binary numbers with negative numbers represented in signed-2's-complement form is obtained from the addition of the two numbers, including their sign bits.  A carry out of the sign-bit position is discarded. Example:

Binary Codes ■ BCD Code A number with k decimal digits will require 4k bits in BCD. Decimal 396 is represented in BCD with 12bits as , with each group of 4 bits representing one decimal digit. A decimal number in BCD is the same as its equivalent binary number only when the number is between 0 and 9. A BCD number greater than 10 looks different from its equivalent binary number, even though both contain 1's and 0's. Moreover, the binary combinations 1010 through 1111 are not used and have no meaning in BCD.

Signed Binary Numbers ■ Arithmetic Subtraction  In 2 ’ s-complement form: 1.Take the 2 ’ s complement of the subtrahend (including the sign bit) and add it to the minuend (including sign bit). 2.A carry out of sign-bit position is discarded. Example: (  6)  (  13)(  ) ( ) (+ 7)

Binary Codes Example: Consider decimal 185 and its corresponding value in BCD and binary: ■ BCD Addition

Binary Codes Example: Consider the addition of = 760 in BCD: ■ Decimal Arithmetic

Binary Codes ■ Other Decimal Codes

Binary Codes ■ Gray Code

Binary Codes ■ ASCII Character Code

Binary Codes ■ ASCII Character Code

ASCII Character Codes American Standard Code for Information Interchange 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) Other non-printing characters are used for record marking and flow control (e.g. STX and ETX start and end text areas). (Refer to Table 1.7)

ASCII Properties ASCII has some interesting properties:  Digits 0 to 9 span Hexadecimal values to  Upper case A -Z span to 5A 16.  Lower case a -z span to 7A 16. Lower to upper case translation (and vice versa) occurs byflipping bit 6.  Delete (DEL) is all bits set, a carryover from when punched paper tape was used to store messages.  Punching all holes in a row erased a mistake!

Binary Codes ■ Error-Detecting Code  To detect errors in data communication and processing, an eighth bit is sometimes added to the ASCII character to indicate its parity.  A parity bit is an extra bit included with a message to make the total number of 1's either even or odd. Example: Consider the following two characters and their even and odd parity:

Binary Codes ■ Error-Detecting Code 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 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.

Binary Storage and Registers ■ Registers  A binary cell is a device that possesses two stable states and is capable of storing one of the two states.  A register is a group of binary cells. A register with n cells can store any discrete quantity of information that contains n bits. n cells 2 n possible states A binary cell –two stable state –store one bit of information –examples: flip-flop circuits, ferrite cores, capacitor A register –a group of binary cells –AX in x86 CPU Register Transfer –a transfer of the information stored in one register to another –one of the major operations in digital system –an example

Transfer of information

The other major component of a digital system –circuit elements to manipulate individual bits of information

Binary Logic ■ Definition of Binary Logic  Binary logic consists of binary variables and a set of logical operations. The variables are designated by letters of the alphabet, such as A, B, C, x, y, z, etc, with each variable having two and only two distinct possible values: 1 and 0, There are three basic logical operations: AND, OR, and NOT.

Binary Logic ■ The truth tables for AND, OR, and NOT are given in Table 1.8.

Binary Logic ■ Logic gates  Example of binary signals

Binary Logic ■ Logic gates  Graphic Symbols and Input-Output Signals for Logic gates: Fig. 1.4 Symbols for digital logic circuits Fig. 1.5 Input-Output signals for gates

Binary Logic ■ Logic gates  Graphic Symbols and Input-Output Signals for Logic gates: Fig. 1.6 Gates with multiple inputs

Number-Base Conversions

Complements

Signal Example – Physical Quantity: Voltage Threshold Region

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

A Digital Computer Example Synchronous or Asynchronous? Inputs: Keyboard, mouse, modem, microphone Outputs: CRT, LCD, modem, speakers

Binary Codes for Decimal Digits Decimal8,4,2,1 Excess3 8,4,-2,-1 Gray  There are over 8,000 ways that you can chose 10 elements from the 16 binary numbers of 4 bits. A few are useful:

UNICODE UNICODE extends ASCII to 65,536 universal characters codes –For encoding characters in world languages –Available in many modern applications –2 byte (16-bit) code words –See Reading Supplement – Unicode on the Companion Website

Negative Numbers Complements –1's complements –2's complements –Subtraction = addition with the 2's complement –Signed binary numbers »signed-magnitude, signed 1's complement, and signed 2's complement.

M - N M + the 2 ’ s complement of N –M + (2 n - N) = M - N + 2 n If M ≧ N –Produce an end carry, 2 n, which is discarded If M < N –We get 2 n - (N - M), which is the 2 ’ s complement of (N-M)

Binary Storage and Registers A binary cell –two stable state –store one bit of information –examples: flip-flop circuits, ferrite cores, capacitor A register –a group of binary cells –AX in x86 CPU Register Transfer –a transfer of the information stored in one register to another –one of the major operations in digital system –an example

Special Powers of 2  2 10 (1024) is Kilo, denoted "K"  2 20 (1,048,576) is Mega, denoted "M"  2 30 (1,073, 741,824)is Giga, denoted "G"

To convert to decimal, use decimal arithmetic to form  (digit × respective power of 2). Example:Convert to N 10 : Converting Binary to Decimal

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

Commonly Occurring Bases Name Radix Digits Binary 2 0,1 Octal 8 0,1,2,3,4,5,6,7 Decimal 10 0,1,2,3,4,5,6,7,8,9 Hexadecimal 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F  The six letters (in addition to the 10 integers) in hexadecimal represent:

Binary Numbers and Binary Coding Information Types –Numeric »Must represent range of data needed »Represent data such that simple, straightforward computation for common arithmetic operations »Tight relation to binary numbers –Non-numeric »Greater flexibility since arithmetic operations not applied. »Not tied to binary numbers

Number of Elements Represented Given n digits in radix r, there are r n distinct elements that can be represented. But, you can represent m elements, m < r n Examples: –You can represent 4 elements in radix r = 2 with n = 2 digits: (00, 01, 10, 11). –You can represent 4 elements in radix r = 2 with n = 4 digits: (0001, 0010, 0100, 1000). –This second code is called a "one hot" code.

Binary Coded Decimal (BCD) The BCD code is the 8,4,2,1 code. This code is the simplest, most intuitive binary code for decimal digits and uses the same powers of 2 as a binary number, but only encodes the first ten values from 0 to 9. Example: 1001 (9) = 1000 (8) (1) How many “ invalid ” code words are there? What are the “ invalid ” code words?

What interesting property is common to these two codes? Excess 3 Code and 8, 4, –2, –1 Code DecimalExcess 38, 4, – 2, –

What special property does the Gray code have in relation to adjacent decimal digits? Gray Code Decimal8,4,2,1 Gray

Does this special Gray code property have any value? An Example: Optical Shaft Encoder B B 1 B 2 (a) Binary Code for Positions 0 through 7 G 0 G 1 G (b) Gray Code for Positions 0 through 7 Gray Code (Continued)

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 = (This is conversion) 13  0001|0011 (This is coding)

Single Bit Binary Addition with Carry

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

Binary Multiplication

BCD Arithmetic  Given a BCD code, we use binary arithmetic to add the digits: Eight Plus is 13 (> 9)  Note that the result is MORE THAN 9, so must be represented by two digits!  To correct the digit, subtract 10 by adding 6 modulo Eight Plus is 13 (> 9) so add 6 carry = leaving 3 + cy 0001 | 0011 Final answer (two digits)  If the digit sum is > 9, add one to the next significant digit

BCD Addition Example Add 2905 BCD to 1897 BCD showing carries and digit corrections

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

4-Bit Parity Code Example Fill in the even and odd parity bits: The codeword "1111" has even parity and the codeword "1110" has odd parity. Both can be used to represent 3- bit data. Even Parity Odd Parity Message - Parity Message - Parity