Binary Decoders |
Navigation |
|
|
Binary Decoders
A Decoder is the exact opposite to that of an "Encoder" we looked at in the last tutorial.
It is basically, a combinational type logic circuit that converts the binary code data at its input into one of a number of
different output lines, one at a time producing an equivalent decimal code at its output. Binary Decoders
have inputs of 2-bit, 3-bit or 4-bit codes depending upon the number of data input lines, and a "n-bit" decoder has
2n output lines. Typical combinations of decoders include, 2-to-4, 3-to-8 and 4-to-16 line configurations.
Binary Decoders are available to "decode" either a Binary or BCD input pattern to typically a Decimal output code.
A 2-to-4 Binary Decoders.
In this simple example of a 2-to-4 line binary decoder, the binary inputs A and
B determine which output line from D0 to D3
is "HIGH" at logic level "1" while the remaining outputs are held "LOW" at logic "0". Therefore, whichever output line is
"HIGH" identifies the binary code present at the input, in other words it "de-codes" the binary input and these types of
binary decoders are commonly used as Address Decoders in microprocessor memory applications.
Memory Address Decoder.
In modern microprocessor systems the amount of memory required can be quite high and is generally more
than one single memory chip alone. One method of overcoming this problem is to connect lots of individual memory chips
together and to read the data on a common "Data Bus". In order to prevent the data being "read" from each memory chip at
the same time, each memory chip is selected individually one at time and this process is known as
Address Decoding.
Each memory chip has an input called Chip Select or CS which is used by the MPU to
select the appropriate memory chip and a logic "1" on this input selects the device and a logic "0" on the input
de-selects it. By selecting or de-selecting each chip, allows us to select the correct memory device for a particular
address and when we specify a particular memory address, the corresponding memory location exists ONLY in one of the
chips.
For example, Lets assume we have a very simple microprocessor system with only 1Kb of RAM memory and
10 address lines. The memory consists of 128x8-bit (128x8 = 1024 bytes) devices and for 1Kb we will need 8 individual memory
devices but in order to select the correct memory chip we will also require a 3-to-8 line binary decoder as shown below.
Memory Address Decoding.
The binary decoder requires 3 address lines, (A0 to
A2) to select each one of the 8 chips (the lower part of the address), while the
remaining 7 address lines (A3 to A9) select the
correct memory location on that chip (the upper part of the address). Having selected a memory location using the address
bus, the information at the particular internal memory location is sent to the "Data Bus" for use by the microprocessor.
This is of course a simple example but the principals remain the same for all types of memory chips or modules.
Binary Decoders are very useful devices for converting one digital format to another,
such as binary or BCD type data into decimal or octal etc and commonly available decoder IC's are the TTL 74LS138 3-to-8 line
binary decoder or the 74ALS154 4-to-16 line decoder. They are also very useful for interfacing to 7-segment displays such as
the TTL 74LS47 which we will look at in the next tutorial.
|