Decimal To BC-Encoder V2
Decimal To BC-Encoder V2
Project Report
On
Encoders are the opposite of decoders. They are used to generate a coded output from a single
active numeric input. To illustrate this in a simple manner, let’s take a look at the simple
decimal-to-BCD encoder circuit shown below. In this circuit, normally all lines are held high by
the pull-up resistors connected to +5 V. To generate a BCD output that is equivalent to a single
selected decimal input, the switch corresponding to that decimal is closed. (The switch acts as an
active-low input.) The truth table in Fig. 12.39 explains the rest. Figure 12.40 shows a 74LS147
decimal-to-BCD (10-line-to-4-line) priority encoder IC. The 74LS147 provides the same basic
function as the circuit shown in Fig. 12.39, but it has active-low outputs. This means that instead
of getting an LLHH output when “3” is selected, as in the previous encoder, you get HHLL. The
two outputs represent the same thing (“3”); one is expressed in positive true logic, and the other
(the 74LS147) is expressed in negative true logic. If you do not like negative true logic, you can
slap inverters on the outputs of the 74LS147 to get positive true logic. The choice to use positive
or negative true logic really depends on what you are planning to drive. For example, negative
true logic is useful when the device that you wish to drive uses active-low inputs.
fixed number of bits, usually four or eight, although other sizes (such as six bits) have
been used historically. Special bit patterns are sometimes used for a sign or for other
In byte-oriented systems (i.e. most modern computers), the term uncompressed BCD
usually implies a full byte for each digit (often including a sign), whereas packed BCD
typically encodes two decimal digits within a single byte by taking advantage of the fact
that four bits are enough to represent the range 0 to 9. The precise 4-bit encoding may
BCD's main virtue is a more accurate representation and rounding of decimal quantities
binary positional systems, BCD's principal drawbacks are a small increase in the
complexity of the circuits needed to implement basic arithmetics and a slightly less
dense storage.
BCD was used in many early decimal computers. Although BCD is not as widely used
as in the past, decimal fixed-point andfloating-point formats are still important and
conversion and rounding errors that are inherent to floating point binary representations
cannot be tolerated.
DECIMAL to BCD ENCODER DIGRAM
DECIMAL to BCD ENCODER TRUTH TABLE
74LS147 decimal-to-4-bit BCD Priority Encoder IC
Another important difference between the two encoders is the term priority that is used with the
74LS147 and not used with the encoder in Fig. 12.39. The term priority is applied to the
74LS147 because this encoder is designed so that if two or more inputs are selected at the same
time, it will only select the larger-order digit. For example, if 3, 5, and 8 are selected at the same
time, only the 8 (negative true BCD LHHH or 0111) will be output. The truth table in Fig. 12.40
demonstrates this look at the “don’t care” or “X” entries. With the non priority encoder, if two or
more inputs are applied at the same time, the output will be unpredictable. The circuit shown in
Fig. 12.41 provides a simple illustration of how an encoder and a decoder can be used together to
drive an LED display via a 0-to-9 keypad. The 74LS147 encodes a keypad’s input into BCD
(negative logic). A set of inverters then converts the negative true BCD into positive true BCD.
The transformed BCD is then fed into a 7447 seven-segment LED display decoder/driver IC.
Figure 12.42 shows a 74148 octal-to-binary priory encoder IC. It is used to transform a specified
single octal input into a binary 3-bit output code. As with the 74LS147, the 74148 comes with a
priority feature, meaning, again, that if two or more inputs are selected at the same time, only the
higher order number is selected. complement and ten’s complement. The active-high BCD code
is applied to inputs A through E. The G input is an active-low enable input.
Application
The BIOS in many personal computers stores the date and time in BCD because
the MC6818 real-time clock chip used in the original IBM PC AT motherboard provided
the time encoded in BCD. This form is easily converted into ASCII for display. [4]
The Atari 8-bit family of computers used BCD to implement floating-point algorithms.
The MOS 6502 processor used has a BCD mode that affects the addition and
subtraction instructions.
Early models of the PlayStation 3 store the date and time in BCD. This led to a
worldwide outage of the console on 1 March 2010. The last two digits of the year stored
functionalities inoperable.
Conclusions
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/c0925083170.htm.
4. ^ http://www.se.ecu.edu.au/units/ens1242/lectures/ens_Notes_08.pdf
5. ^ "Signalling Protocols and Switching (SPS) Guidelines for using Abstract Syntax Notation One
http://www.etsi.org/deliver/etsi_etr/001_099/060/02_60/etr_060e02p.pdf.