home *** CD-ROM | disk | FTP | other *** search
- BINARY TO BCD CONVERTER
-
- This binary to BCD converter accepts a 7-bit binary number in the range
- 0000000b to 1100011b and converts it to a pair of decimal digits. For
- example, the following conversions will be performed.
-
- BINARY[6..0] UPPER[3..0] LOWER[3..0]
-
- 0000000 0 0
- 0000001 0 1
- 0010000 1 6
- 0111111 6 3
- 1000000 6 4
- 1100011 9 9
-
- No actual devices is assigned, so this corresponds to a trial run to see
- how many product terms are required before an actual device is assigned.
-
- | in:BINARY[6..0], out:(UPPER[3..0], LOWER[3..0])
- |
- | Title: "Binary to BCD converter"
- |
- | Map: BINARY[6..0] -> UPPER[3..0], n=0..99 { n -> n/10 }
- | Map: BINARY[6..0] -> LOWER[3..0], n=0..99 { n -> n\10 }
- |
- | Vectors:
- | { Display BINARY[6..0], " -> ", (UPPER[3..0])d, ", ", (LOWER[3..0])d
- | Test BINARY[6..0]
- | End }
-
-