Binary-to-BCD Converter Lecture L6.2 Section 6.5 pp. 101-106.

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.
CDA 3100 Recitation Week 10.
Logic Circuits Design presented by Amr Al-Awamry
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.
Magnitude Comparator Lecture L6.4 Section 6.1.
NUMBER SYSTEM. How to convert hexadecimal numbers to decimal numbers? 230 Working from right to left, MULTIPLY each position with 8 raised to the power.
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.
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.
Designing State Machines Lecture L9.2 Handout Section 9.2.
Datapaths Lecture L10.2 Sections 10.2, ALU (Sect. 7.5 and Lab 6)
Arbitrary Waveforms Lecture L8.5 Section 7.2. CLK DQ !Q CLK DQ !Q CLK DQ !Q Q0Q0.D Q1 Q2 Q1.D Q2.D s s s s3 0 1.
Counters as State Machines Lecture L9.1 Handout Section 9.1.
Equality Detector Lecture L6.1 Section 6.1. Equality Detector XNOR X Y Z Z = !(X $ Y) X Y Z
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.
Modulo-N Counters Lecture L8.4 Section 7.2. Counters Modulo-5 Counter 3-Bit Down Counter with Load and Timeout Modulo-N Down Counter.
Codes and Code Converters
Code Converters Module M7.1 Section 6.5. Code Converters Binary-to-BCD Converters ABEL TRUTH_TABLE Command.
Arithmetic Logic Unit (ALU) Lecture L7.5 Section 7.5.
Pulse-Width Modulated DAC Lecture 11.3 Section 11.5.
Multiplexers Module M6.1 Section 6.4. Multiplexers A 4-to-1 MUX TTL Multiplexer A 2-to-1 MUX.
2’s Complement 4-Bit Saturator
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.
Analog-to-Digital Converters Lecture L11.2 Section 11.3.
Flip-Flops Lecture L8.2 Section 8.1. Recall the !S-!R Latch !S !R Q !Q !S !R Q !Q X Y nand 1 0 Set 1 0.
Digital to Analog (D/A) Converter Discussion D2.2.
Decoders Module M9.1 Section 6.3. Decoders TTL Decoders.
Arithmetic Logic Unit (ALU) Lecture L9.3 Lab 10. ALU CB = carry_borrow flag Z = zero flag (Z = 1 if Y = 0)
Virtual Wallet Design of BCD Binary Converters To create a handheld device which will save money and time through budget assistance and improve the shopping.
CS 140L Lecture 7 Professor CK Cheng 11/12/02. Transformation between Mealy and Moore Machines Algorithm: 1) For each NS, z = S i, j create a state S.
Shift Registers Lecture L6.6 Section Bit Shift Register.
Equality Detector Lecture L6.3 Section 6.1. Equality Detector XNOR X Y Z Z = !(X $ Y) X Y Z
7-Segment Displays Module M7.2 Section 6.5. Turning on an LED Common Anode.
Binary-to-BCD Converter
ENGIN112 L12: Circuit Analysis Procedure September 29, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 12 Circuit Analysis Procedure.
Binary-to-BCD Converter
Address Decoders Lecture L6.10 Section 6.3. MOUSE Layout PROM 2716 RAM 6810 MPU 6802 PIA 6821 Address Bus (16 lines) Data Bus (8 lines) To outside world.
Lecture 13 Problems (Mano)
Designing Combinational Logic Circuits in Verilog - 2
Logic Design CS221 1 st Term sequential circuits Cairo University Faculty of Computers and Information.
CS 151: Digital Design Chapter 3 3-8: Encoding. CS 151 Encoding Encoding - the opposite of decoding - the conversion of a maximum of 2 n input code to.
ABCDNumber = Off 1 = On Binary Coded Decimal (BCD)
Binary-to-BCD Converter
A little bit of exercise.. ;). Exercise Given to you are some binary to decimal examples : Given to you are some binary to decimal examples : Tens Units.
9/15/09 - L24 Other FF TypesCopyright Joanne DeGroat, ECE, OSU1 Other FF Types.
Abdullah Said Alkalbani University of Buraimi
CS151 Introduction to Digital Design
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
Counters and Registers Synchronous Counters. 7-7 Synchronous Down and Up/Down Counters  In the previous lecture, we’ve learned how synchronous counters.
1 CS 151: Digital Design Chapter 3: Combinational Logic Design 3-1Design Procedure CS 151: Digital Design.
CEC 220 Digital Circuit Design
Decoders A decoder is a logic circuit that detects the presence of a specific combination of bits at its input. Two simple decoders that detect the presence.
Digital Logic & Design Dr. Waseem Ikram Lecture No. 35.
COMPUTER ORGANIZATION 4 TH LECTURE. ASCII Code  ASCII ( American Standard Code for Information Interchange).  Input and output devices that communicate.
Magnitude Comparator Module M5.2 Section 6.1.
Counters as State Machines
Logic Design Review – 2 Basic Combinational Circuits
Shift Registers Lecture L8.6 Section 8.3.
Analog-to-Digital Converters
Binary-to-BCD Converter
Number Systems and Circuits for Addition
Dr. Clincy Professor of CS
Magnitude Comparator Lecture L6.2 Section 6.1.
Presentation transcript:

Binary-to-BCD Converter Lecture L6.2 Section 6.5 pp

Shift and Add-3 Algorithm S1. Shift the binary number left one bit. 22. If 8 shifts have taken place, the BCD number is in the Hundreds, Tens, and Units column. 33. If the binary value in any of the BCD columns is 5 or greater, add 3 to that value in that BCD column. 44. 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 C A3 A2 A1 A0 S3 S2 S1 S0

K-Map for S3 A3 A2 A1 A X S3 = A3 # A2 & A0 # A2 & A1 XXX X X

Binary-to-BCD Converter

Binary-to-BCD Converter

MODULE binbcd interface([B7..B0] -> [P9..P0]); TITLE 'binary-bcd converter' DECLARATIONS Cadd3 interface([A3..A0] -> [S3..S0]); C1 FUNCTIONAL_BLOCK Cadd3; C2 FUNCTIONAL_BLOCK Cadd3; C3 FUNCTIONAL_BLOCK Cadd3; C4 FUNCTIONAL_BLOCK Cadd3; C5 FUNCTIONAL_BLOCK Cadd3; C6 FUNCTIONAL_BLOCK Cadd3; C7 FUNCTIONAL_BLOCK Cadd3;

" INPUT PINS " B7..B0 PIN; B = [B7..B0]; " 8-bit binary input " OUTPUT PINS " P9..P0 PIN ISTYPE 'com'; P = [P9..P0]; " 10-bit BCD output

EQUATIONS C1.A3 = 0; C1.[A2..A0] = [B7..B5]; C2.[A3..A1] = C1.[S2..S0]; C2.A0 = B4; C3.[A3..A1] = C2.[S2..S0]; C3.A0 = ___; C4.[A3..A1] = ___________; C4.A0 = ___; C5.[A3..A1] = ___________; C5.A0 = ___; C6.A3 = ___; C6.A2 = ______; C6.A1 = ______; C6.A0 = ______; C7.[A3..A1] = ___________; C7.A0 = ______;

P9 = C6.S3; [P8..P5]= ___________; [P4..P1]= ___________; P0 = 16; test_vectors (B -> P) 0FF -> 255; 35 -> 53; 0B9 -> 185; 0D5 -> 213; 0E7 -> ____; 94 -> ____; 51 -> ____; END binbcd

6-Bit Binary-to-BCD Converter C1.A3 = 0; C1.[A2..A0] = [B5..B3]; C2.[A3..A1] = C1.[S2..S0]; C2.A0 = B2; C3.[A3..A1] = C2.[S2..S0]; C3.A0 = B1; P6 = C1.S3; P5 = C2.S3; [P4..P1]= C3.[S3..S0]; P0 = B0;