Problem – Make a digital circuit that takes a BCD digit as input and produces the output that is equal to 5 times the digit in same format.
Drawing K-maps for all the outputs:
Can you come up with a better solution for this problem? Let us know with your comments.
Next read: Digital counters
Solution – Binary Coded Decimal (BCD) is the format to represent decimal numbers in binary form. In this format, each digit of the decimal number is coded separately into 4-bit binary number. So, only binary values from 0000 to 1001 are valid codes. E.g. A two digit decimal number will be coded into BCD code with 8 binary digits.
The truth table for X5 multiplier can be represented as
shown in the figure below:
BCD
input
|
BCD
output
|
I3
|
I2
|
I1
|
I0
|
H3
|
H2
|
H1
|
H0
|
L3
|
L2
|
L1
|
L0
|
0
|
00
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
1
|
05
|
0
|
0
|
0
|
1
|
0
|
0
|
0
|
0
|
0
|
1
|
0
|
1
|
2
|
10
|
0
|
0
|
1
|
0
|
0
|
0
|
0
|
1
|
0
|
0
|
0
|
0
|
3
|
15
|
0
|
0
|
1
|
1
|
0
|
0
|
0
|
1
|
0
|
1
|
0
|
1
|
4
|
20
|
0
|
1
|
0
|
0
|
0
|
0
|
1
|
0
|
0
|
0
|
0
|
0
|
5
|
25
|
0
|
1
|
0
|
1
|
0
|
0
|
1
|
0
|
0
|
1
|
0
|
1
|
6
|
30
|
0
|
1
|
1
|
0
|
0
|
0
|
1
|
1
|
0
|
0
|
0
|
0
|
7
|
35
|
0
|
1
|
1
|
1
|
0
|
0
|
1
|
1
|
0
|
1
|
0
|
1
|
8
|
40
|
1
|
0
|
0
|
0
|
0
|
1
|
0
|
0
|
0
|
0
|
0
|
0
|
9
|
45
|
1
|
0
|
0
|
1
|
0
|
1
|
0
|
0
|
0
|
1
|
0
|
1
|
X
|
XX
|
1
|
0
|
1
|
0
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
XX
|
1
|
0
|
1
|
1
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
XX
|
1
|
1
|
0
|
0
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
XX
|
1
|
1
|
0
|
1
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
XX
|
1
|
1
|
1
|
0
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
XX
|
1
|
1
|
1
|
1
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
X
|
K Map for H3, L3 and L1
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
=> H3
= L3= L1 = 0
Similarly, by solving using K-Maps for all the outputs, we get
H2 = I3
H1 = I2
H0 = I1
L2 = L0 = I0
Thus, all the outputs are either a direct connection from one of the inputs or zero. So, the whole function can be implemented without using a single logic gate. Sounds strange!!!
Can you come up with a better solution for this problem? Let us know with your comments.
Next read: Digital counters
Also read:
Nice. well explained
ReplyDeleteWe can implement using MUX and flip flop and adder . See multiple of 5 means adding number of 5's we can simply implement using MUX, adder,flip flop without using k map
ReplyDeleteHi Meghna
DeleteYes, you are right. There can be many solutions to a single problem. The solution that has been talked about in this post is with combinatorial design. The one you are talking about is sequential/FSM design. It will be interesting to see how the solution is figured out.
Very good write-up on topics in vlsi
ReplyDeleteThankyou for this beautiful explanation!
ReplyDeleteImplement with only adder:
ReplyDeleteAx5 = Ax4+A = Ax2^2+A = (A<<2)+A
Hi Stas
DeleteYes, a similar approach can be tried, the question is BCD multiply by 5. But yes, good approach. :-)