Presentation is loading. Please wait.

Presentation is loading. Please wait.

Code Converters Module M7.1 Section 6.5. Code Converters Binary-to-BCD Converters ABEL TRUTH_TABLE Command.

Similar presentations


Presentation on theme: "Code Converters Module M7.1 Section 6.5. Code Converters Binary-to-BCD Converters ABEL TRUTH_TABLE Command."— Presentation transcript:

1 Code Converters Module M7.1 Section 6.5

2 Code Converters Binary-to-BCD Converters ABEL TRUTH_TABLE Command

3 Binary-to-BCD Converter

4 bin2bcd.abl MODULE bin2bcd TITLE 'Binary to binary coded decimal, A. Student, 7/12/02' DECLARATIONS " INPUT PINS " I3..I0 PIN 6,7,11,5;“ Switch 1..4 I = [I3..I0];" 4-bit input vector " OUTPUT PINS " [E,D,C,B,A] PIN 40,39,37,36,35 ISTYPE 'com';" LED 4..8 BCD = [E,D,C,B,A]; EDCBA I = 1110 1 4

5 EQUATIONS @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)

6 Gray Code Conversion 0000 0011 0112 0103 1104 1115 1016 1007 Gray Code Decimal equivalent G_in = [G2..0]; G_out = [B2..0]; 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]

7 Gray Code Conversion 0000 0011 0112 0103 1104 1115 1016 1007 Gray Code Decimal equivalent G_in = [G2..0]; G_out = [B2..0]; 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]


Download ppt "Code Converters Module M7.1 Section 6.5. Code Converters Binary-to-BCD Converters ABEL TRUTH_TABLE Command."

Similar presentations


Ads by Google