The Digital Codes.

Slides:



Advertisements
Similar presentations
Computer Codes Rohit Khokher. Computer Codes Data types NumericNonnumeric IntegerRealAlphabet A, B, C, …,Z a, b, c,…,z Digits 0,…,9 Special Characters.
Advertisements

Company LOGO Edit your slogan here DKT 122/3 DIGITAL SYSTEM 1 WEEK #3 NUMBER SYSTEMS, OPERATION & CODES (PART 2)
CHAPTER 2 Number Systems, Operations, and Codes
ECE 331 – Digital System Design
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Representing Information as Bit Patterns Lecture 4 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
Overview Digital Systems and Computer Systems Number Systems [binary, octal and hexadecimal] Arithmetic Operations Base Conversion Decimal Codes [BCD (binary.
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
ASCII & Gray Codes.
CODING SYSTEMS CODING SYSTEMS CODING SYSTEMS. CHARACTERS CHARACTERS digits: 0 – 9 (numeric characters) letters: alphabetic characters punctuation marks:
9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU1 Codes.
1.6 Signed Binary Numbers.
Number Systems and Codes
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Programmable Logic Controllers
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Digital Systems and Logic Design
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
Binary Arithmetic & Data representation
Morgan Kaufmann Publishers
NUMBER SYSTEM AND COMPUTER CODES Chapter 2. Prelude Fingers, sticks, and other things for counting were not enough! Counting large numbers Count in groups.
Functions of Combinational Logic
1 INFORMATION IN DIGITAL DEVICES. 2 Digital Devices Most computers today are composed of digital devices. –Process electrical signals. –Can only have.
CS151 Introduction to Digital Design
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 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.
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.
1 IT 231, CMPE 331 Digital Logic Design Week 2 Number systems and arithmetic.
1. Number Systems Chapt. 2 Location in course textbook.
Data Representation Conversion 24/04/2017.
Data Representation, Number Systems and Base Conversions
ECE 331 – Digital System Design Representation and Binary Arithmetic of Negative Numbers and Binary Codes (Lecture #10) The slides included herein were.
ECE 301 – Digital Electronics Representation of Negative Numbers, Binary Arithmetic of Negative Numbers, and Binary Codes (Lecture #11) The slides included.
Ahmad Almulhem, KFUPM 2009 COE 202: Digital Logic Design Number Systems Part 4 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
Agenda Character representation Numerical Conversions ASCII EBCDIC
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.
Assoc. Prof. Dr. Ahmet Turan ÖZCERİT.  The necessity and advantages of coding  The variety of coding systems You will learn: 2.
MECH1500 Chapter 3.
DIGITAL SYSTEMS Number systems & Arithmetic Rudolf Tracht and A.J. Han Vinck.
CCE Department – Faculty of engineering - Islamic University of Lebanon Chapter 6 Binary Arithmetic.
Module –I Codes: Weighted and non-weighted codes
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Introduction to Digital Electronics Lecture 2: Number Systems.
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.
Nguyen Le CS147.  2.4 Signed Integer Representation  – Signed Magnitude  – Complement Systems  – Unsigned Versus Signed Numbers.
Dr. Nermin Hamza. Agenda Signed Numbers Properties of Switching Algebra.
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.
Introduction to signals The signals are broadly classified into two categories: 1. Analog Signals. 2. Digital signals.
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.
COMPUTER ORGANIZATION 4 TH LECTURE. ASCII Code  ASCII ( American Standard Code for Information Interchange).  Input and output devices that communicate.
EI205 Lecture 2 Dianguang Ma Fall, 2008.
Lecture No. 4 Number Systems
Data Transfer ASCII FILES.
Number systems and codes
UNIT I: Introduction to Number Systems and
COMS 161 Introduction to Computing
Chapter 1 Number System RGGP, Narwana.
C1 Number systems.
COMS 161 Introduction to Computing
2’s Complement form 1’s complement form 2’s complement form
ECE 331 – Digital System Design
Presentation transcript:

The Digital Codes

Binary Coded Decimal (BCD) Would it be easy for you if you can replace a decimal number with an individual binary code? Such as 00011001 = 1910 The 8421 code is a type of BCD to do that. BCD code provides an excellent interface to binary systems: Keypad inputs Digital readouts

Binary Coded Decimal Let’s crack these… ex1: dec-to-BCD 35 98 170 2469 Decimal Digit 1 2 3 4 5 6 7 8 9 BCD 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 Note: 1010, 1011, 1100, 1101, 1110, and 1111 are INVALID CODE! Let’s crack these… ex1: dec-to-BCD 35 98 170 2469 ex2: BCD-to-dec 10000110 001101010001 1001010001110000

BCD Addition BCD is a numerical code and can be used in arithmetic operations. Here is how to add two BCD numbers: Add the two BCD numbers, using the rules for basic binary addition. If a 4-bit sum is equal to or less than 9, it is a valid BCD number. If a 4-bit sum > 9, or if a carry out of the 4-bit group is generated it is an invalid result. Add 6 (0110) to a 4-bit sum in order to skip the six the invalid states and return the code to 8421. If a carry results when 6 is added, simply add the carry to the next 4-bit group.

BCD Addition Try these: ex: Add the following numbers (a) 0011+0100

The Gray Code The Gray code is unweighted and is not an arithmetic code. There are no specific weights assigned to the bit positions. Important: the Gray code exhibits only a single bit change from one code word to the next in sequence. This property is important in many applications, such as shaft position encoders.

The Gray Code Decimal Binary Gray Code 0000 1 0001 2 0010 0011 3 4 0000 1 0001 2 0010 0011 3 4 0100 0110 5 0101 0111 6 7 Decimal Binary Gray Code 8 1000 1100 9 1001 1101 10 1010 1111 11 1011 1110 12 13 14 15

The Gray Code Binary-to-Gray code conversion The MSB in the Gray code is the same as corresponding MSB in the binary number. Going from left to right, add each adjacent pair of binary code bits to get the next Gray code bit. Discard carries. ex: convert 101102 to Gray code 1 + 0 + 1 + 1 + 0 binary 1 1 1 0 1 Gray

The Gray Code Gray-to-Binary Conversion The MSB in the binary code is the same as the corresponding bit in the Gray code. Add each binary code bit generated to the Gray code bit in the next adjacent position. Discard carries. ex: convert the Gray code word 11011 to binary 1 1 0 1 1 Gray + + + + 1 0 0 1 0 Binary

The Gray Code - Application Bit 0 Bit 1 Bit 2 Bit 3 http://www.mipraso.de/enzyklopaedie/g/gray-code-scheibe.gif http://www.engr.colostate.edu/~dga/mechatronics/figures/9-11.gif

Alphanumeric Codes Represent numbers and alphabetic characters. Also represent other characters such as symbols and various instructions necessary for conveying information. The ASCII is the most common alphanumeric code. ASCII = American Standard Code for Information Interchange

ASCII ASCII has 128 characters and symbols represented by a 7-bit binary code. It can be considered an 8-bit code with the MSB always 0. (00h-7Fh) 00h-1Fh (the first 32) – control characters 20h-7Fh – graphics symbols (can be printed or displayed)

ASCII Table http://ascii-table.com/img/table.gif

Extended ASCII There are an additional 128 characters that were adopted by IBM for use in their PCs. It’s popular and is used in applications other than PCs  unofficial standard. The extended ASCII characters are represented by an 8-bit code series from 80h-FFh

Extended ASCII Table http://ascii-table.com/img/table-pc.gif