Codes and Code Converters

Slides:



Advertisements
Similar presentations
Modulo-N Counters Module M10.4 Section 7.2.
Advertisements

Encoders Module M9.3 Section 6.3. Encoders Priority Encoders TTL Encoders.
Demultiplexers Module M6.4 Section 6.4. Demultiplexers YIN 1 x 4 DeMUX d0d1 Y0 Y1 Y2 Y3 Y0 Y1 Y2 Y3 d1d0 0 0 YIN YIN YIN
Shift Registers Module M11.1 Section 7.3.
7-Segment Displays Lecture L6.1 Section 6.3. Turning on an LED.
Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
HEXADECIMAL NUMBERS Code
Company LOGO Edit your slogan here DKT 122/3 DIGITAL SYSTEM 1 WEEK #3 NUMBER SYSTEMS, OPERATION & CODES (PART 2)
Binary Counters Module M10.3 Section 7.2. Counters 3-Bit Up Counter 3-Bit Down Counter Up-Down Counter.
7-Segment Displays Lecture L6.7 Section 6.5. Turning on an LED.
Binary-to-BCD Converter Lecture L6.2 Section 6.5 pp
Multiplier Lecture L7.3 Section 10.4 (p.276) Section 7.3 (Handout)
Multiplexers Lecture L6.4 Section 6.4.
Subtractors Module M8.2 Section 6.2. Subtractors Half Subtractor Full Subtractor Adder/Subtractor - 1 Adder/Subtractor - 2.
Flip-Flops Module M10.2 Section 7.1. D Latch Q !Q CLK D !S !R S R X 0 Q 0 !Q 0 D CLK Q !Q Note that Q follows D when the clock in high, and.
Binary Counters Lecture L8.3 Section 8.2. Counters 3-Bit Up Counter 3-Bit Down Counter Up-Down Counter.
Shifter Lecture L7.4 Group HW #4 Section 10.3.
Code Converters Module M7.1 Section 6.5. Code Converters Binary-to-BCD Converters ABEL TRUTH_TABLE Command.
Multiplexers Module M6.1 Section 6.4. Multiplexers A 4-to-1 MUX TTL Multiplexer A 2-to-1 MUX.
Adders Lecture L7.1 Section 6.2 Section 10.4 (pp )
Shifters Lecture L7.4 Section 7.4. MODULE shift TITLE 'shifter' DECLARATIONS " INPUT PINS " D3..D0 PIN 11,7,6,5; D = [D3..D0]; s2..s0 PIN 3,2,1; S.
Decoders Module M9.1 Section 6.3. Decoders TTL Decoders.
Shift Registers Lecture L6.6 Section Bit Shift Register.
DIGITAL SYSTEMS TCE OTHER COMBINATIONAL LOGIC CIRCUITS WEEK 7 AND WEEK 8 (LECTURE 1 OF 3) COMPARATORS CODE CONVERTERS.
7-Segment Displays Module M7.2 Section 6.5. Turning on an LED Common Anode.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Binary-to-BCD Converter
Binary-to-BCD Converter
Number Systems and Codes Discussion D4.1. Number Systems Counting in Binary Positional Notation Hexadecimal Numbers Negative Numbers.
REPRESENTING INFORMATION: BINARY, HEX, ASCII C ORRESPONDING R EADING : UDC C HAPTER 2 CMSC 150: Lecture 2.
ASCII & Gray Codes.
FIGURES FOR CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
1.6 Signed Binary Numbers.
Revision Introductory Lesson
Programmable Logic Controllers
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
Designing Combinational Logic Circuits in Verilog - 2
ABCDNumber = Off 1 = On Binary Coded Decimal (BCD)
Binary-to-BCD Converter
Chapter 3 Section 1 Number Representation Modern cryptographic methods, unlike the classical methods we just learned, are computer based. Representation.
1 Lecture 3 ENGRE 254 1/14/09. 2 Lecture 1 review Digital signals assume two values represented by “0” and “1”. Typically a “0” represents a voltage near.
AEEE2031 Data Representation and Numbering Systems.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Introduction to Microprocessors Chapter 2. Decimal or Base 10 Numbers  Have ten different digits (0-9)  It is a weighted number system. Each position.
Digital Systems Digital Logic and Design Dr. Musab Bassam Zghool Text Book: Mano Morris M. “ Digital Logic And Computer Design ”
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
MECH1500 Chapter 3.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
ECE DIGITAL LOGIC LECTURE 2: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/14/2016.
Digital Systems: Number Systems and Codes Wen-Hung Liao, Ph.D.
Chapter 32 Binary Number System. Objectives After completing this chapter, you will be able to: –Describe the binary number system –Identify the place.
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.
Decoder Chapter 12 Subject: Digital System Year: 2009.
Coding Part 2. Weight of the Digit 3672 Thousands (10 3 )Hundreds (10 2 )Tens (10 1 )Units (1) = Weights Decimal Example (3672) 10 Binary.
COMPUTER ORGANIZATION 4 TH LECTURE. ASCII Code  ASCII ( American Standard Code for Information Interchange).  Input and output devices that communicate.
Programmable Logic Controller
CHAPTER 1 : INTRODUCTION
Logic Design Review – 2 Basic Combinational Circuits
Digital Systems: Number Systems and Codes
Shift Registers Lecture L8.6 Section 8.3.
Binary-to-BCD Converter
COMS 161 Introduction to Computing
There are 10 types of people of people in this world…
Lecture 9: Radix-64 Tutorial
COMS 161 Introduction to Computing
Remember the 10 types of people of people in this world…
COMS 161 Introduction to Computing
UNIT – 3 & 4. Data Representation and Internal
Presentation transcript:

Codes and Code Converters Lecture L6.12 Section 6.5 Section 9.5

Codes and Code Converters ASCII Binary-to-BCD Converters Gray Code Bar Codes

Standard ASCII Codes Standard Table 9.2 ASCII codes Dec Hex @ P p ! A 16 32 48 64 80 96 112 Hex 1 2 3 4 5 6 7 NUL DLE blank @ P p SOH DC1 ! A Q a q STX DC2 " B R b r ETX DC3 # C S c s EOT DC4 $ D T d t ENQ NAK % E U e u ACK SYN & F V f v BEL ETB ' G W g w 8 BS CAN ( H X h x 9 HT EM ) I Y i y 10 LF SUB * : J Z j z 11 VT ESC + ; K [ k { 12 FF FS , < L \ l | 13 CR GS - = M ] m } 14 SO RS . > N ^ n ~ 15 SI US / ? O _ o DEL

ASCII Codes

Definitions of ASCII Control Characters

Codes and Code Converters ASCII Binary-to-BCD Converters Gray Code Bar Codes

Binary-to-BCD Converter

bin2bcd.abl E D C B A I = 1110 1 4 MODULE bin2bcd 1 4 MODULE bin2bcd TITLE 'Binary to binary coded decimal'   DECLARATIONS " INPUT PINS " I3..I0 PIN 11,7,6,5; " Switches S6 - 1..4 I = [I3..I0]; " 4-bit input vector " OUTPUT PINS " [E,D,C,B,A] PIN 5,4,3,2,1 ISTYPE 'com'; " LEDs 12..16 BCD = [E,D,C,B,A];

bin2bcd.abl (cont’d) EQUATIONS @radix 16; " Identify the Hex Base   @radix 16; " Identify the Hex Base truth_table ( I -> BCD ) " Binary to BCD Code Converter 0 -> 00; 1 -> 01; 2 -> 02; 3 -> 03; 4 -> 04; 5 -> 05; 6 -> 06; 7 -> 07; 8 -> 08; 9 -> 09; 0A -> 10; 0B -> 11; 0C -> 12; 0D -> 13; 0E -> 14; 0F -> 15; END bin2bcd bin2bcd.abl (cont’d)

Shift and Add-3 Algorithm   1.      Shift the binary number left one bit. 2.      If 8 shifts have taken place, the BCD number is in the Hundreds, Tens, and Units column. 3.      If the binary value in any of the BCD columns is 5 or greater, add 3 to that value in that BCD column. 4.      Go to 1.

Steps to convert an 8-bit binary number to BCD

Example of converting hex E to BCD

Truth table for Add-3 Module A3 A2 A1 A0 C S3 S2 S1 S0

Binary-to-BCD Converter

Binary-to-BCD Converter

Other Binary Coded Decimal Representations

Codes and Code Converters ASCII Binary-to-BCD Converters Gray Code Bar Codes

Gray Code Note that the least significant bit that can be changed without repeating a value is the bit that is changed

Gray codes eliminate errors Binary Code

Gray Code Conversion Gray Code Decimal equivalent G_in = [G2..0]; G_out = [B2..0]; 000 0 001 1 011 2 010 3 110 4 111 5 101 6 100 7 Truth_table (G_in => G_Out) Fill in this TRUTH_TABLE Command so as to convert the Gray code input, [G2..0], to the binary output, [B2..0]

Gray Code Conversion Gray Code Decimal equivalent G_in = [G2..0]; G_out = [B2..0]; 000 0 001 1 011 2 010 3 110 4 111 5 101 6 100 7 Truth_table (G_in => G_Out) 0 -> 0; 1 -> 1; 3 -> 2; 2 -> 3; 6 -> 4; 7 -> 5; 5 -> 6; 4 -> 7; Fill in this TRUTH_TABLE Command so as to convert the Gray code input, [G2..0], to the binary output, [B2..0]

Codes and Code Converters ASCII Binary-to-BCD Converters Gray Code Bar Codes

Code 39 Bar Code A B C D 3-of-9 bars are WIDE bars (Bars can be black or white)