1 Digital Design Debdeep Mukhopadhyay Associate Professor Dept of Computer Science and Engineering NYU Shanghai and IIT Kharagpur.

Slides:



Advertisements
Similar presentations
Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
Advertisements

DATA REPRESENTATION CONVERSION.
Chapter 1 Binary Systems 1-1. Digital Systems
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Chapter 1 Number Systems and Codes
Wakerly Section 2.4 and further Addition and Subtraction of Nondecimal Numbers.
Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
7/2/2015Errors1 Transmission errors are a way of life. In the digital world an error means that a bit value is flipped. An error can be isolated to a single.
CS2100 Computer Organisation
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
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
Number System and Codes
Number Systems and Codes
Number Systems and Arithmetic
Information Representation and Number Systems BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
Data Representation – Chapter 3 Sections 3-2, 3-3, 3-4.
1.6 Signed Binary Numbers.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Digital Systems and Logic Design
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
Binary Arithmetic & Data representation
Morgan Kaufmann Publishers
Topic 2 – Introduction to Computer Codes. Computer Codes A code is a systematic use of a given set of symbols for representing information. As an example,
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.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
Yuh-Jzer JoungDigital Systems1 Number Systems decimal number : 7397=7× × × ×10 0 a 4 a 3 a 2 a 1 a 0. a -1 a -2 = a 4 ×10 4 +a 3 ×10.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
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
Number Systems and Codes. CS2100 Number Systems and Codes 2 NUMBER SYSTEMS & CODES Information Representations Number Systems Base Conversion Negative.
1 EENG 2710 Chapter 1 Number Systems and Codes. 2 Chapter 1 Homework 1.1c, 1.2c, 1.3c, 1.4e, 1.5e, 1.6c, 1.7e, 1.8a, 1.9a, 1.10b, 1.13a, 1.19.
ECE 301 – Digital Electronics Unsigned and Signed Numbers, Binary Arithmetic of Signed Numbers, and Binary Codes (Lecture #2)
Summer 2012ETE Digital Electronics1 Binary Arithmetic of Signed Binary Numbers.
ECE 2110: Introduction to Digital Systems BCD, Gray, Character, Action/Event, Serial Data.
Number systems, Operations, and Codes
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
ECE 2110: Introduction to Digital Systems Signed Addition/Subtraction.
1. Number Systems Chapt. 2 Location in course textbook.
Ch 2. Number Systems and Codes 2.2 Octal and Hexadecimal Numbers 10 ~ 15 : Alphabet.
AEEE2031 Data Representation and Numbering Systems.
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
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.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
MECH1500 Chapter 3.
DIGITAL SYSTEMS Number systems & Arithmetic Rudolf Tracht and A.J. Han Vinck.
NUMBER SYSTEMS AND CODES. CS Digital LogicNumber Systems and Codes2 Outline Number systems –Number notations –Arithmetic –Base conversions –Signed.
Module –I Codes: Weighted and non-weighted codes
Number Representation and Arithmetic Circuits
ECE DIGITAL LOGIC LECTURE 4: BINARY CODES Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/26/2016.
Integer Operations Computer Organization and Assembly Language: Module 5.
Binary Addition and Subtraction. Arithmetic Operations Arithmetic operations in a computer are done using binary numbers and not decimal numbers and these.
Computer Math CPS120 Introduction to Computer Science Lecture 7.
CHAPTER 3 BINARY NUMBER SYSTEM. Computers are electronic machines which operate using binary logic. These devices use two different values to represent.
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.
COSC2410: LAB 2 BINARY ARITHMETIC SIGNED NUMBERS FLOATING POINT REPRESENTATION BOOLEAN ALGEBRA 1.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
CS2100 Computer Organisation
CS2100 Computer Organisation
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CS1010 Programming Methodology
Chapter 1 Number Systems, Number Representations, and Codes
Data Representation – Chapter 3
ECE 331 – Digital System Design
Presentation transcript:

1 Digital Design Debdeep Mukhopadhyay Associate Professor Dept of Computer Science and Engineering NYU Shanghai and IIT Kharagpur

2 Number Systems and Codes

3 Number Systems Decimal number: = Base b number: N = a q-1 b q-1 + … + a 0 b 0 + … + a -p b -p b >1, 0 <= a i <= b-1 Integer part: a q-1 a q-2 … a 0 Fractional part: a -1 a -2 … a -p Most significant digit: a q-1 Least significant digit: a -p Binary number (b=2): = Representing number N in base b: (N) b Complement of digit a: a’ = (b-1)-a Decimal system: 9’s complement of 3 = 9-3 = 6 Binary system: 1’s complement of 1 = 1-1 = 0

4 Representation of Integers

5 Conversion of Bases Example: Base 8 to base 10 (432.2) 8 = = (282.25) 10 Example: Base 2 to base 10 ( ) 2 = = (13.25) 10 Base b 1 to b 2, where b 1 > b 2 :

6 Conversion of Bases (Contd.) Example: Convert (548) 10 to base 8 Thus, (548) 10 = (1044) 8 Thus, (345) 10 = (1333) 6 Example: Convert (345) 10 to base 6

7 Converting Fractional Numbers Fractional number: Example: Convert (0.3125) 10 to base = hence a -1 = = hence a -2 = 4 Thus, (0.3125) 10 = (0.24) 8

8 Decimal to Binary Example: Convert ( ) 10 to binary

9 Decimal to Binary Example: Convert ( ) 10 to binary = hence a -1 = = hence a -2 = = hence a -3 = = hence a -4 = = hence a -5 = = hence a -6 = 0 a -7 = 1 etc. Thus, ( ) 10 = ( …) 2

10 Octal/Binary Conversion Example: Convert (123.4) 8 to binary (123.4) 8 = ( ) 2 Example: Convert ( ) 2 to octal ( ) 2 = ( ) 2 = (126.24) 8

11 Binary Arithmetic

12 Binary Addition/Subtraction Example: Binary addition 1111 = carries of = (15.25) = ( 7.50) = (22.75) 10 Example: Binary subtraction 1 = borrows of = (18.75) = (12.50) = ( 6.25) 10

13 Binary Multiplication/Division Example: Binary multiplication = (25.5) = ( 6.5) = (165.75) 10 Example: Binary division = quotient = remainder

Binary and Weighted Codes Although binary systems have advantages in digital computers (to control the switches), humans work in decimal systems. It is convenient to represent decimal digits by sequence of binary digits. Several coding techniques have been developed to do so. Decimal digits: 0, 1, …, 9 (10) can be represented by 4 bits. Since, we need 10 out of 16 values, several codes possible. Weighted Codes: If x 1, x 2, x 3, x 4 are the binary digits, with weights w 1, w 2, w 3, w 4, then the decimal digit is: N=w 4 x 4 +w 3 x 3 +w 2 x 2 +w 1 x 1 We say, the sequence (x 1, x 2, x 3, x 4 ) denotes the code word for N. 14

15 Binary Codes BCD Self-complementing code: Code word of 9’s complement of N obtained by interchanging 1’s and 0’s in the code word of N Self-complementing Codes Is this unique?

16 Nonweighted Codes Add 3 to BCD Successive code words differ in only one digit Can you see some interesting properties in the excess-3 code?

17 Gray Code

18 Binary Gray Example: Binary: Gray: Gray-to-binary: b i = g i if no. of 1’s preceding g i is even b i = g i ’ if no. of 1’s preceding g i is odd

19 Reflection of Gray Codes

20 Error-detecting Codes p: parity bit; even parity used in above codes Distance between codewords: no. of bits they differ in Minimum distance of a code: smallest no. of bits in which any two code words differ Minimum distance of above single error-detecting codes = 2

21 Hamming Codes: Single Error-correcting Minimum distance for SEC or double-error detecting (DED) codes = 3 Example: {000,111} Minimum distance for SEC and DED codes = 4 No. of information bits = m No. of parity check bits, p 1, p 2, …, p k = k No. of bits in the code word = m+k Assign a decimal value to each of the m+k bits: from 1 to MSB to m+k to LSB Perform k parity checks on selected bits of each code word: record results as 0 or 1 Form a binary number (called position number), c 1 c 2 …c k, with the k parity checks

22 Hamming Codes (Contd.) No. of parity check bits, k, must satisfy: 2 k >= m+k+1 Example: if m = 4 then k =3 Place check bits at the following locations: 1, 2, 4, …, 2 k-1 Example code word: Check bits: p 1 = 1, p 2 = 1, p 3 = 0 Information bits: 0, 1, 1, 0

23 Hamming Code Construction Select p 1 to establish even parity in positions: 1, 3, 5, 7 Select p 2 to establish even parity in positions: 2, 3, 6, 7 Select p 3 to establish even parity in positions: 4, 5, 6, 7

24 Hamming Code Construction (Contd.) Position: p 1 p 2 m 1 p 3 m 2 m 3 m 4 Original BCD message: Parity check in positions 1,3,5,7 requires p 1 =1: Parity check in positions 2,3,6,7 requires p 2 =0: Parity check in positions 4,5,6,7 requires p 3 =1: Coded message:

25 Hamming Code for BCD Position: Intended message: Message received: parity check: c 1 = 1 since parity is odd parity check: c 2 = 0 since parity is even parity check: c 3 = 1 since parity is odd

26 SEC/DED Code Add another parity bit such that all eight bits have even parity Two errors occur: overall parity check satisfied, but position number indicates error double error (cannot be corrected) Single error occurs: overall parity check not satisfied Position no. is 0: error in last parity bit Else, position no. indicates erroneous bit No error occurs: all parity checks indicate even parities