Prof. Dr. Thorsten Jungmann (last updated 2026-11-02)

Relates to DET-05 Codes, code converters and standard components

Task

A clock in the binary-coded decimal (BCD) code shows the time with 20 light emitting diodes (LEDs) in six columns, for the tens and units of the hours, the minutes and the seconds. Each column shows one decimal digit in the BCD code, with the weights 8, 4, 2 and 1 from top to bottom:

The 20 LEDs of the BCD clock in six columns with the weights 8, 4, 2 and 1; lit are the LEDs with the weight 1 in the first column, 8 and 1 in the second, 4 in the third, 4, 2 and 1 in the fourth, 2 and 1 in the fifth, and 4 and 1 in the sixth
The 20 LEDs of the BCD clock in six columns with the weights 8, 4, 2 and 1; lit are the LEDs with the weight 1 in the first column, 8 and 1 in the second, 4 in the third, 4, 2 and 1 in the fourth, 2 and 1 in the fifth, and 4 and 1 in the sixth

The clock does not drive all 20 LEDs at once. An integrated circuit HEF4051 works as a demultiplexer, and its outputs to switch the six columns on one after another. Its three address inputs select the column: the address 000 selects the tens of the hours, the address 101 the units of the seconds. As long as its enable input is 0, it works; at , no column is on. For each column, the microcontroller applies the BCD code word of its digit.

A 1-to-8 demultiplexer according to IEC 60617 with the enable input E, the address inputs A0 to A2 and an input fixed at 1; the outputs 0 to 5 are the columns C1 to C6 of the BCD clock, and the outputs 6 and 7 are not used
A 1-to-8 demultiplexer according to IEC 60617 with the enable input E, the address inputs A0 to A2 and an input fixed at 1; the outputs 0 to 5 are the columns C1 to C6 of the BCD clock, and the outputs 6 and 7 are not used

a) What time does the clock in the first figure show?

b) Fill in the gaps for this time. The table shows what happens in each of the six time slots.

Column that is onDigitWeight 8Weight 4Weight 2Weight 1
000tens of the hours10001
001units of the hours
010tens of the minutes
011
100
101

c) Fill in the gaps in the truth table of the column selection, and give the logic expression of .

0000100000
0010
0101
0110
1101

d) Which LEDs are lit during the time slot with the address 011? Why does the clock not use the addresses 110 and 111?

e) How many electric lines lead from the microcontroller to the demultiplexer and to the LEDs in this way, if stays at 0? How many would it need with one electric line for each LED?

f) Each column is on for one of six equal time slots. For which part of the time does an LED that belongs to a lit digit shine? Why do you still see all lit LEDs at once?

◀️ Back to the task


Solution

Given

Given explicitly:

  • the 20 light emitting diodes (LEDs) in six columns with the weights 8, 4, 2 and 1, and the lit LEDs in the first figure
  • the address inputs , and , from 000 for the tens of the hours to 101 for the units of the seconds
  • the enable input : at 1, no column is on
  • for each column, the microcontroller applies the BCD code word of its digit

Known:

  • Binary-coded decimal (BCD) code and reading the clock (DET-05)
  • Demultiplexer, enable input (DET-05, DET-05)
  • The HEF4051 in the clock and time-division multiplexing (DET-05)

Required

a) the time
b) the complete table of the six time slots
c) the complete truth table and the expression of
d) the lit LEDs for the address 011, and why the addresses 110 and 111 are not used
e) the number of electric lines in both cases
f) the part of the time and why you see all LEDs at once

a) Reading the time

Read the figure column by column, and add the weights of the lit LEDs (DET-05, 1.3):

ColumnLit weightsDigit
tens of the hours11
units of the hours8 + 19
tens of the minutes44
units of the minutes4 + 2 + 17
tens of the seconds2 + 13
units of the seconds4 + 15

Check: the tens of the hours do not exceed 2, and those of the minutes and seconds do not exceed 5, as the columns with two and three LEDs require ✓

b) The six time slots

The address selects the column, and the microcontroller applies the code word of its digit (DET-05, 5.3):

Column that is onDigitWeight 8Weight 4Weight 2Weight 1
000tens of the hours10001
001units of the hours91001
010tens of the minutes40100
011units of the minutes70111
100tens of the seconds30011
101units of the seconds50101

c) Truth table of the column selection

Each output of the demultiplexer is 1 for exactly one address, as long as is 0. The input is fixed at 1, so the outputs are the minterms of the address inputs, as in a decoder (DET-05, 5.2), and the enable input is a further condition:

0000100000
0010001000
0101000001
0110000000
1101000000

Check with the address 010: only is 1, and the third column, the tens of the minutes, is the one with the address 2 ✓

d) The time slot with the address 011

The address 011 is the number 3, and this selects column 4, the units of the minutes. The digit 7 has the code word 0111, so the LEDs with the weights 4, 2 and 1 of this column are lit. All other columns are off during this time slot.

The clock has six columns, and three address inputs give eight addresses. The addresses 110 and 111 would select the outputs 6 and 7, which are connected to nothing, so the clock has no use for them.

e) Number of electric lines

In each time slot, the code word needs four electric lines, one for each weight, and the address needs three. With at 0, this makes electric lines from the microcontroller. With one electric line for each LED, it would need 20. This is the saving that time-division multiplexing brings (DET-05, 5.3).

f) Part of the time

Each column gets one of six equal time slots, so an LED of a lit digit shines for one sixth of the time. The clock runs through the columns so fast that your eye cannot follow, and you see all lit LEDs at once (DET-05, 5.3).

The simulation shows the column selection and, as a block, the microcontroller with the code words of the time 19:47:35. Switch the address inputs through the addresses 000 to 101 and compare with the table of b). You do by hand what the clock does much faster. With at 1, no column is on, whatever the address says.

Simulation of the column selection of the BCD clock with a demultiplexer and a block for the microcontroller: the address 000 switches column 1 on, and the block delivers the code word 0001 of the digit one
Simulation of the column selection of the BCD clock with a demultiplexer and a block for the microcontroller: the address 000 switches column 1 on, and the block delivers the code word 0001 of the digit one

Open in the simulator