SlideShare a Scribd company logo
4
Most read
IOSR Journal of Electronics and Communication Engineering (IOSR-JECE)
e-ISSN: 2278-2834,p- ISSN: 2278-8735.Volume 10, Issue 1, Ver. III (Jan - Feb. 2015), PP 73-78
www.iosrjournals.org
DOI: 10.9790/2834-10137378 www.iosrjournals.org 73 | Page
Design, Construction and Operation of a 4-Bit Counting Circuit
Brian E. Usibe* and Julie C. Ogbulezie
Department of Physics, University of Calabar P.M.B. 1115 Calabar, Nigeria
Abstract: A four-bit binary counting circuit was designed and constructed. The materials used were; PIC
Microcontroller, Seven-segment LED, Printed Circuit Board, LEDs, Transistors, 9v DC power source (Battery),
and other passive components. The method adopted for this counter makes use of a microcontroller as the backbone
of the design, which holds the command for every action that is to occur during an operation. The output (results) of
the circuit was indicated by four Light Emitting Diodes (LEDs) with counts; 0000, 0001, 0010, 0011, 0100, 1010,
0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110 and 1111. These binary outputs were further converted to
decimal equivalent through a reprogrammable microcontroller and then displayed using a dual seven-segment
display device.
Keywords: Counting circuit, PIC microcontroller, seven-segment display, logic systems.
I. INTRODUCTION
An instrument which, in its simplest form, provides an output that corresponds to the number of pulses
applied to its input is termed a digital counter. In digital logic, a counter is a device which stores (and sometimes
displays) the number of times a particular event or process has occurred, often in relationship to a clock signal. A
circuit which performs this function and has these characteristics is generally referred to as a digital counter [1].
Counting circuits belong to a particular class of sequential circuits. Each has one particular input and a
number of outputs which follows some digital codes. The counter itself is a J-K flip-flop. Two major types of
counting circuits exist; the Batch and the Measurement types [2].
Digital counters operate in the binary number system. This is so because binary system is easily and
quickly carried out with electronic circuitry. Computer information is expressed in binary form (bits) because of the
convenience of handling two clearly-defined states. Each bit is either a ZERO or a ONE, OFF or ON, LOW or
HIGH, etc [3]. Fig 1 and table 1 illustrate a 4–bit binary counter that can count from 0 to 15. The 16th
count input
causes the counter to return to the 0 output and generate a carry pulse. This action of a counter to return to the 0 state
with a carry output on every 16th
pulse makes the 4–bit binary a modulo-16 (mod 16) counter. Modulus counter
means it operates the predetermined state. For example, in mod-10 counter, it counts only 10 states.
Fig. 1: Schematic symbol
The four binary outputs: QD, QC, QB and QA in figure.1 are said to have an 8-4-2-1 weighting because if QD through
QA are all 1s, then the binary counter output would be;
11112 = (1x23
) + (1x22
) + (1x21
) + (1x20
) = 8 + 4 + 2 + 1 = 1510
The subscripts indicate the base of the system.
Table 1: Counter output in various number systems
No. of
count
pulse
Binary
output
Octal
(Base
8)
Decimal
(Base 10)
Hexadecimal
(Base 16)
0 0000 0 0 0
1 0001 1 1 1
2 0010 2 2 2
3 0011 3 3 3
4 0100 4 4 4
5 0101 5 5 5
6 0110 6 6 6
7 0111 7 7 7
Design, Construction and Operation of A 4-Bit Counting Circuit
DOI: 10.9790/2834-10137378 www.iosrjournals.org 74 | Page
8 1000 10 8 8
9 1001 11 9 9
10 1010 12 10 A
11 1011 13 11 B
12 1100 14 12 C
13 1101 15 13 D
14 1110 16 14 E
15 1111 17 15 F
16 0000 0 0 0
II. THEORY
Every counting circuit consists of four basic units –the sensing unit, the signal conditioning unit, the
counter unit and the output unit [4]
The sensing unit is usually made of a photoelectric device or a switch or a capacity pick-up or an
interruptible jet. Its function is to detect what needs to be counted. The signal-conditioning unit is usually an
interfacing device such as R-C Discriminator circuit. Its function is to arrange the „sensed‟ signal or object into a
countable form. The counter, which is usually the shift register of a J-K flip-flop records the event or object time-
wise. The out put device can be an indicating visual meter or an audible beep producer. However, in this work, a
PIC microcontroller would be used in place of the traditional J-K flip-flop.
The primary Boolean rule applicable for the manipulation of this counting circuit is the Exclusive-OR
(XOR).
Table 2: Truth table for XOR Gate
A B P
0 0 0
0 1 1
1 0 1
1 1 0
III. MATERIALS AND METHODS
1. Materials used in the construction
The materials used during the construction of the circuit include; soldering iron, soldering lead, soldering
pump, side cutter, digital multi-meter, sand paper and electrician knife, as well as plastic Perspex for the casing.
The binary counting circuit comprises of four (4) distinct sections. The hardware is a collection of Light
Emitting Diodes, Seven Segment Display and some resistors that limit current for both the Light Emitting Diodes
and the seven segment display. These components are interfaced to the microcontroller in order to output the
required result in a more interpretable format.
The method adopted for this counter makes use of a microcontroller as the backbone of the design, which
holds the command for every action that is to occur during an operation. Reason for this method is to reduce number
of components and improve the functionality of the circuit. Figure 2 shows the block diagram of the counting
circuit.
Fig. 2: Block diagram of a 4-bit binary counting circuit
2. Design stage
The design stages for the 4-bit binary counter comprises the sequential connection of the power supply, the
seven segment display, the binary status LED indicators and the Microcontroller. The various units that constitute
the system would be built onto a Printed Circuit Board, tested and then eventually inter-connected. For reasons of
operational flexibility, reliability, and reproducibility, specialized integrated circuit like microcontroller would be
POWER
SUPPLY
MICRO-
CONTROLLER
SEVEN
SEGMENT
DISPLAY
BINARY
STATUS LED
INDICATORS
Design, Construction and Operation of A 4-Bit Counting Circuit
DOI: 10.9790/2834-10137378 www.iosrjournals.org 75 | Page
used.
The microcontroller is the heart of the entire design. It processes the binary information and displays it on
the four Binary Status LED indicators, at the same time, converts the generated binary to decimal value then
displays it on the seven segment display. The microcontroller also manages the dual seven segment display by way
of multiplexing the displays which helps in reducing complex wiring in the diagram.
Fig. 3: Circuit for the binary LED and the Microcontroller stage
The voltage drop across the seven segments LED is 2V [6]. Since a 5V supply is used in powering both the seven
segments LED display and the LEDs, this leaves 3V across their respective resistors. Therefore, current through the
seven segment LED display is:
𝐼 = 𝑉/𝑅 = 3/150 = 0.02𝐴. (1)
While that of the LED is:
𝐼 = 𝑉/𝑅 = 3/330 = 0.009𝐴 (2)
Equations 1 and 2 can be written as
𝑅 = 𝑉𝑆 – 𝑉𝐷 / 𝐼 (3)
Where VS is supply voltage and VD is LED voltage drop. [7]
From equation 3, resistor value for seven segment display is
𝑅 = 5 – 2/0.02 = 3/0.02 = 150
Switching transistor
Using transistor BC 548, Supply voltage, Vs = 9V
The load driven by the transistor is the relay Load resistance, RL = 150
Load current 𝐿𝐼 = 𝑉𝑠/𝑅𝐿 = 9/150 = 60𝑚𝐴 (4)
Design, Construction and Operation of A 4-Bit Counting Circuit
DOI: 10.9790/2834-10137378 www.iosrjournals.org 76 | Page
Since Load current LI (max) must be greater than IC and from the data sheet Ic (max) = 100mA
The Base Resistor, RB
𝑅𝐵 = 𝑉𝑐𝑐 × ℎ𝑓𝑒 5 × 𝐼𝑐 (5)
Where
IC = collector current
Vcc = supply voltage [8]
Therefore RB = 9 × 400 5 × 100 = 7.2 KΩ
Where the typical hfe = 400 (from data sheet). Therefore, the closet value for the base resistor is selected to be 10KΩ.
3. Schematic and Printed Circuit Board
The effective and reliable design and production of the schematic and PCB creates better performance and
consistent results. The software used in creating the PCBs and schematic diagram is Dip Trace, which was
downloaded from www.diptrace.com. Crosschecking of footprints and design procedures was necessary to ensure a
favourable outcome. After converting the schematic into PCB, a laser jet printer was used in the printing of the
converted design into a special material known as Press and Peel sheet, a transparent film used in PCB production.
IV. RESULTS AND DISCUSSIONS
The binary to decimal and all the algorithm conversions and counting are implemented in the firmware of
PIC16F628. The result is finally displayed on the Dual Seven Segment LED display. The software was compiled
with the mikroC Pro for PIC compiler from mikroElektronika. The firmware was compiled into a machine code
using the same Editor, and programmed into the microcontroller. The simulation of the algorithm of the detector
system was done using Proteus software from Lab Center Electronics. Figure 5 shows the constructed circuit.
Fig. 5: The constructed 4-bit binary counter
The following results were obtained at each count pulse.
Table 10: Counter output obtained at each count pulse
Pulse
No/
SSD
LED 1 LED 2 LED 3 LED 4
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
Design, Construction and Operation of A 4-Bit Counting Circuit
DOI: 10.9790/2834-10137378 www.iosrjournals.org 77 | Page
9 1 0 0 1
10 1 0 1 0
11 1 0 1 1
12 1 1 0 0
13 1 1 0 1
14 1 1 1 0
15 1 1 1 1
4.1 Mode of operation of the counter
A multiplex dual 7-segment display was employed in order to display the binary equivalent that is
generated at a time. The Microcontroller used in the design is a type PIC16F628. This is one of the most recent
Microcontrollers and has a built-in oscillator and can be reprogrammed. The reset pin (4) of the microcontroller is
made positive by the 10KΩ pull-up resistor and a switch in order for the PIC to function properly. If the counter is
to be reset, the switch can be pressed, pulling pin 4 to 0V for a moment. The “trigger reaction” signal from the push
button is fed to the pin RA1 of the microcontroller. The 10KΩ resistors pull these inputs to +5V and 0V when the
push button is pressed, in which case the appropriate input is made negative (logic 0). The LEDs are driven from the
microcontroller pins RA0, RA2, RA3 and RA4, respectively, via 10KΩ pull-up resistors. Pins RB0, RB1, RB2 and
RB3 provide a Binary Coded Decimal (BCD) output equivalent to the number that will be displayed on the Seven
Segment Display. This binary is converted to a seven-segment output by the microcontroller and the outputs to the
dual seven segment display are delivered from pins RB0 to RB7 via 330Ω current limiting resistors. The complete
circuit diagram for the 4-Bit Binary Counter is shown in figure 4.
There is insufficient power from the microcontroller to drive the dual displays, and in any case, it is
customary to use “strobes” (multiplexing) to drive two displays from one set of segment outputs. Virtually all
displays are driven in this way. This explains why calculators and other digital electronic devices often appear to
flicker when filmed with a video camera. Strobe is achieved by careful programming, and the use of microcontroller
pin RA7 and RA8 to control which display is lit at any one time.
When RA7 and RA8 are at logic 1, current flows through the 10kΩ current limiting resistor into the base of
the two transistors. Hence the transistor switches on, and their collectors are effectively pulled to 0V, via their
emitters. The collectors of the transistors are connected to the display common cathode Pins and so the display is
able to light up according to the binary coded output. However, when RA7 and RA8 are at logic 0 (0V), the two
transistors turned off, and so no current will flow to the display and hence the display stays off. Decoupling of the
supply is provided by electrolytic capacitors and a 9V PP3 battery provides the necessary power supply.
Fig. 4: Schematic Layout of the 4-Bit Binary Counter
4.2 Applications of the circuit
The designed and constructed 4-bits counter can find application in the following areas:
(1) It is used essentially in digital computers and other digital devices for memory storage and counting in different
bases.
(2) The binary counting circuit can be modified and used in radioactivity Rate Meter for count rate per record.
(3) It can be modified and applied in frequency-dividing operations.
(4) It can be used in digital clocks and timers for counting events.
Design, Construction and Operation of A 4-Bit Counting Circuit
DOI: 10.9790/2834-10137378 www.iosrjournals.org 78 | Page
V. CONCLUSION
Digital counting circuits are vital in everyday Electronics. They are used not only in counting, but in the
conversion from one number base to another. Although, counters can also be designed/constructed using multi-
vibrators, this research has used the PIC Microcontroller, showing that it is the best method, as it makes use of a
firmware for its operation, at the same time reducing the number of components in the circuit. Again, the chip could
be reprogrammed for the realization of other types of counters.
REFERENCES
[1]. Menkiti, A.I. Computer Logic and Architecture. University of Calabar Press, Calabar, Nigeria, 2011.
[2]. Bozie, S.M. Electronics and switching circuits. Edward Arnold Publication, London, 1979.
[3]. Givant, S. and Halmos, P. Introduction to Boolean Algebra. Undergraduate Text in Mathematics, Sprinter Pub., 2009.
[4]. Hill, J.F. and Peterson, G.R. Introduction to switching theory and logical design. John Wiley and Sons, New York, 1974.
[5]. Patton, A. An introduction to digital logic. Macmillan Books, London, 1973.
[6]. Mandll, M. Directory of electronics circuits with glossary of terms. Eaglewood Cliffs, New Jersey, 1978.
[7]. Jaegar, R. C. Microelectronics circuit design. McGraw Hill. pp.226-233, 1997
[8]. Haykinl, S.S. Transistor circuits in electronics. Liffer Books, London, 1971.

More Related Content

PDF
FPGA based synchronous multi-channel PWM generator for humanoid robot
PDF
Micro Processor Lab Manual!
PDF
Implementation of an Improved Microcontroller Based Moving Message Display Sy...
DOCX
project 3 full report
DOCX
Project Report On 0-9 decade counter
PDF
Network Based Data Acquisition and Logging System using PIC Microcontroller
PDF
Application of Microcontroller in Transmitter Section of Wireless System
DOCX
FPGA Implementation with Digital Devices
FPGA based synchronous multi-channel PWM generator for humanoid robot
Micro Processor Lab Manual!
Implementation of an Improved Microcontroller Based Moving Message Display Sy...
project 3 full report
Project Report On 0-9 decade counter
Network Based Data Acquisition and Logging System using PIC Microcontroller
Application of Microcontroller in Transmitter Section of Wireless System
FPGA Implementation with Digital Devices

What's hot (16)

PDF
Development of Distributed Mains Monitoring and Switching System for Indus Co...
PPTX
Digital Components
DOCX
Dilo lab
PPTX
Electronics counter
PDF
Bv4301417422
PDF
Ju2416921695
PDF
Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C Protocol
PDF
Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters
DOC
Industrial training report of embedded system and robotics
DOCX
digital clock atmega16
PDF
IRJET- Design and Implementation of Telemetry Encoder for Light- Weight Ballo...
PDF
Development and Application of a Failure Monitoring System by Using the Vibra...
PDF
Designing Of Time and Power Efficient Model for Controlling Of Critical Process
PDF
Internet enebled data acquisition and device control
PDF
FAULT SECURE ENCODER AND DECODER WITH CLOCK GATING
PPTX
Badal sharma
Development of Distributed Mains Monitoring and Switching System for Indus Co...
Digital Components
Dilo lab
Electronics counter
Bv4301417422
Ju2416921695
Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C Protocol
Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters
Industrial training report of embedded system and robotics
digital clock atmega16
IRJET- Design and Implementation of Telemetry Encoder for Light- Weight Ballo...
Development and Application of a Failure Monitoring System by Using the Vibra...
Designing Of Time and Power Efficient Model for Controlling Of Critical Process
Internet enebled data acquisition and device control
FAULT SECURE ENCODER AND DECODER WITH CLOCK GATING
Badal sharma
Ad

Viewers also liked (20)

PDF
B017350710
PDF
C010621622
PDF
Application of Roller Burnishing Process for Final Machining Of Cilindrical S...
PDF
A Survey on Mobile Forensic for Android Smartphones
PDF
Big Data Analysis and Its Scheduling Policy – Hadoop
PDF
K010218188
PDF
Comparative Effect of Daily Administration of Allium sativum and Allium cepa ...
PDF
J012315560
PDF
D017212027
PDF
K1102016673
PDF
Use of Polyvinylindene Fluoride (PVDF) and Lead Zirconate Titanate (PZT) In S...
PDF
E1303041923
PDF
F010133036
PDF
O1304039196
PDF
B012620814
PDF
RAPD Analysis Of Rapidly Multiplied In Vitro Plantlets of Anthurium Andreanum...
PDF
N0176195102
PDF
E017332733
PDF
Overview of Improving Robustness of MAODV Protocol by Combining Tree and Mesh...
PDF
Effectiveness of Information Communication Technologies for Education System
B017350710
C010621622
Application of Roller Burnishing Process for Final Machining Of Cilindrical S...
A Survey on Mobile Forensic for Android Smartphones
Big Data Analysis and Its Scheduling Policy – Hadoop
K010218188
Comparative Effect of Daily Administration of Allium sativum and Allium cepa ...
J012315560
D017212027
K1102016673
Use of Polyvinylindene Fluoride (PVDF) and Lead Zirconate Titanate (PZT) In S...
E1303041923
F010133036
O1304039196
B012620814
RAPD Analysis Of Rapidly Multiplied In Vitro Plantlets of Anthurium Andreanum...
N0176195102
E017332733
Overview of Improving Robustness of MAODV Protocol by Combining Tree and Mesh...
Effectiveness of Information Communication Technologies for Education System
Ad

Similar to Design, Construction and Operation of a 4-Bit Counting Circuit (20)

PDF
Counting circuits
PPT
Counters r012
PPTX
Making Of 0-9 Decade Counter with 7 segment display
PPTX
decade counter
PDF
Dsa 170930180124
PDF
Digital dice
PPTX
dsd-II-unit-III-registers-counters (1).pptx
PDF
Ijecet 06 08_001
PDF
Ijecet 06 08_001
PDF
Electronics 2012
PPTX
Digital object counter (group 12)
DOCX
Object counter
PDF
Design of Counter Using SRAM
PDF
a simple bcd counter project
PPTX
eee ppt.pptx
PPTX
Bidirect visitor counter
PDF
FREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdf
PDF
Digital stop watch
PDF
closing-the-hardware-design-loop-with-multisim-a-case-study
DOCX
Digital clock
Counting circuits
Counters r012
Making Of 0-9 Decade Counter with 7 segment display
decade counter
Dsa 170930180124
Digital dice
dsd-II-unit-III-registers-counters (1).pptx
Ijecet 06 08_001
Ijecet 06 08_001
Electronics 2012
Digital object counter (group 12)
Object counter
Design of Counter Using SRAM
a simple bcd counter project
eee ppt.pptx
Bidirect visitor counter
FREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdf
Digital stop watch
closing-the-hardware-design-loop-with-multisim-a-case-study
Digital clock

More from IOSR Journals (20)

PDF
A011140104
PDF
M0111397100
PDF
L011138596
PDF
K011138084
PDF
J011137479
PDF
I011136673
PDF
G011134454
PDF
H011135565
PDF
F011134043
PDF
E011133639
PDF
D011132635
PDF
C011131925
PDF
B011130918
PDF
A011130108
PDF
I011125160
PDF
H011124050
PDF
G011123539
PDF
F011123134
PDF
E011122530
PDF
D011121524
A011140104
M0111397100
L011138596
K011138084
J011137479
I011136673
G011134454
H011135565
F011134043
E011133639
D011132635
C011131925
B011130918
A011130108
I011125160
H011124050
G011123539
F011123134
E011122530
D011121524

Recently uploaded (20)

PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
composite construction of structures.pdf
PPTX
Welding lecture in detail for understanding
PPTX
web development for engineering and engineering
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Construction Project Organization Group 2.pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
OOP with Java - Java Introduction (Basics)
PDF
PPT on Performance Review to get promotions
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
composite construction of structures.pdf
Welding lecture in detail for understanding
web development for engineering and engineering
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Internet of Things (IOT) - A guide to understanding
Operating System & Kernel Study Guide-1 - converted.pdf
Construction Project Organization Group 2.pptx
bas. eng. economics group 4 presentation 1.pptx
OOP with Java - Java Introduction (Basics)
PPT on Performance Review to get promotions
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
CYBER-CRIMES AND SECURITY A guide to understanding
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT

Design, Construction and Operation of a 4-Bit Counting Circuit

  • 1. IOSR Journal of Electronics and Communication Engineering (IOSR-JECE) e-ISSN: 2278-2834,p- ISSN: 2278-8735.Volume 10, Issue 1, Ver. III (Jan - Feb. 2015), PP 73-78 www.iosrjournals.org DOI: 10.9790/2834-10137378 www.iosrjournals.org 73 | Page Design, Construction and Operation of a 4-Bit Counting Circuit Brian E. Usibe* and Julie C. Ogbulezie Department of Physics, University of Calabar P.M.B. 1115 Calabar, Nigeria Abstract: A four-bit binary counting circuit was designed and constructed. The materials used were; PIC Microcontroller, Seven-segment LED, Printed Circuit Board, LEDs, Transistors, 9v DC power source (Battery), and other passive components. The method adopted for this counter makes use of a microcontroller as the backbone of the design, which holds the command for every action that is to occur during an operation. The output (results) of the circuit was indicated by four Light Emitting Diodes (LEDs) with counts; 0000, 0001, 0010, 0011, 0100, 1010, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110 and 1111. These binary outputs were further converted to decimal equivalent through a reprogrammable microcontroller and then displayed using a dual seven-segment display device. Keywords: Counting circuit, PIC microcontroller, seven-segment display, logic systems. I. INTRODUCTION An instrument which, in its simplest form, provides an output that corresponds to the number of pulses applied to its input is termed a digital counter. In digital logic, a counter is a device which stores (and sometimes displays) the number of times a particular event or process has occurred, often in relationship to a clock signal. A circuit which performs this function and has these characteristics is generally referred to as a digital counter [1]. Counting circuits belong to a particular class of sequential circuits. Each has one particular input and a number of outputs which follows some digital codes. The counter itself is a J-K flip-flop. Two major types of counting circuits exist; the Batch and the Measurement types [2]. Digital counters operate in the binary number system. This is so because binary system is easily and quickly carried out with electronic circuitry. Computer information is expressed in binary form (bits) because of the convenience of handling two clearly-defined states. Each bit is either a ZERO or a ONE, OFF or ON, LOW or HIGH, etc [3]. Fig 1 and table 1 illustrate a 4–bit binary counter that can count from 0 to 15. The 16th count input causes the counter to return to the 0 output and generate a carry pulse. This action of a counter to return to the 0 state with a carry output on every 16th pulse makes the 4–bit binary a modulo-16 (mod 16) counter. Modulus counter means it operates the predetermined state. For example, in mod-10 counter, it counts only 10 states. Fig. 1: Schematic symbol The four binary outputs: QD, QC, QB and QA in figure.1 are said to have an 8-4-2-1 weighting because if QD through QA are all 1s, then the binary counter output would be; 11112 = (1x23 ) + (1x22 ) + (1x21 ) + (1x20 ) = 8 + 4 + 2 + 1 = 1510 The subscripts indicate the base of the system. Table 1: Counter output in various number systems No. of count pulse Binary output Octal (Base 8) Decimal (Base 10) Hexadecimal (Base 16) 0 0000 0 0 0 1 0001 1 1 1 2 0010 2 2 2 3 0011 3 3 3 4 0100 4 4 4 5 0101 5 5 5 6 0110 6 6 6 7 0111 7 7 7
  • 2. Design, Construction and Operation of A 4-Bit Counting Circuit DOI: 10.9790/2834-10137378 www.iosrjournals.org 74 | Page 8 1000 10 8 8 9 1001 11 9 9 10 1010 12 10 A 11 1011 13 11 B 12 1100 14 12 C 13 1101 15 13 D 14 1110 16 14 E 15 1111 17 15 F 16 0000 0 0 0 II. THEORY Every counting circuit consists of four basic units –the sensing unit, the signal conditioning unit, the counter unit and the output unit [4] The sensing unit is usually made of a photoelectric device or a switch or a capacity pick-up or an interruptible jet. Its function is to detect what needs to be counted. The signal-conditioning unit is usually an interfacing device such as R-C Discriminator circuit. Its function is to arrange the „sensed‟ signal or object into a countable form. The counter, which is usually the shift register of a J-K flip-flop records the event or object time- wise. The out put device can be an indicating visual meter or an audible beep producer. However, in this work, a PIC microcontroller would be used in place of the traditional J-K flip-flop. The primary Boolean rule applicable for the manipulation of this counting circuit is the Exclusive-OR (XOR). Table 2: Truth table for XOR Gate A B P 0 0 0 0 1 1 1 0 1 1 1 0 III. MATERIALS AND METHODS 1. Materials used in the construction The materials used during the construction of the circuit include; soldering iron, soldering lead, soldering pump, side cutter, digital multi-meter, sand paper and electrician knife, as well as plastic Perspex for the casing. The binary counting circuit comprises of four (4) distinct sections. The hardware is a collection of Light Emitting Diodes, Seven Segment Display and some resistors that limit current for both the Light Emitting Diodes and the seven segment display. These components are interfaced to the microcontroller in order to output the required result in a more interpretable format. The method adopted for this counter makes use of a microcontroller as the backbone of the design, which holds the command for every action that is to occur during an operation. Reason for this method is to reduce number of components and improve the functionality of the circuit. Figure 2 shows the block diagram of the counting circuit. Fig. 2: Block diagram of a 4-bit binary counting circuit 2. Design stage The design stages for the 4-bit binary counter comprises the sequential connection of the power supply, the seven segment display, the binary status LED indicators and the Microcontroller. The various units that constitute the system would be built onto a Printed Circuit Board, tested and then eventually inter-connected. For reasons of operational flexibility, reliability, and reproducibility, specialized integrated circuit like microcontroller would be POWER SUPPLY MICRO- CONTROLLER SEVEN SEGMENT DISPLAY BINARY STATUS LED INDICATORS
  • 3. Design, Construction and Operation of A 4-Bit Counting Circuit DOI: 10.9790/2834-10137378 www.iosrjournals.org 75 | Page used. The microcontroller is the heart of the entire design. It processes the binary information and displays it on the four Binary Status LED indicators, at the same time, converts the generated binary to decimal value then displays it on the seven segment display. The microcontroller also manages the dual seven segment display by way of multiplexing the displays which helps in reducing complex wiring in the diagram. Fig. 3: Circuit for the binary LED and the Microcontroller stage The voltage drop across the seven segments LED is 2V [6]. Since a 5V supply is used in powering both the seven segments LED display and the LEDs, this leaves 3V across their respective resistors. Therefore, current through the seven segment LED display is: 𝐼 = 𝑉/𝑅 = 3/150 = 0.02𝐴. (1) While that of the LED is: 𝐼 = 𝑉/𝑅 = 3/330 = 0.009𝐴 (2) Equations 1 and 2 can be written as 𝑅 = 𝑉𝑆 – 𝑉𝐷 / 𝐼 (3) Where VS is supply voltage and VD is LED voltage drop. [7] From equation 3, resistor value for seven segment display is 𝑅 = 5 – 2/0.02 = 3/0.02 = 150 Switching transistor Using transistor BC 548, Supply voltage, Vs = 9V The load driven by the transistor is the relay Load resistance, RL = 150 Load current 𝐿𝐼 = 𝑉𝑠/𝑅𝐿 = 9/150 = 60𝑚𝐴 (4)
  • 4. Design, Construction and Operation of A 4-Bit Counting Circuit DOI: 10.9790/2834-10137378 www.iosrjournals.org 76 | Page Since Load current LI (max) must be greater than IC and from the data sheet Ic (max) = 100mA The Base Resistor, RB 𝑅𝐵 = 𝑉𝑐𝑐 × ℎ𝑓𝑒 5 × 𝐼𝑐 (5) Where IC = collector current Vcc = supply voltage [8] Therefore RB = 9 × 400 5 × 100 = 7.2 KΩ Where the typical hfe = 400 (from data sheet). Therefore, the closet value for the base resistor is selected to be 10KΩ. 3. Schematic and Printed Circuit Board The effective and reliable design and production of the schematic and PCB creates better performance and consistent results. The software used in creating the PCBs and schematic diagram is Dip Trace, which was downloaded from www.diptrace.com. Crosschecking of footprints and design procedures was necessary to ensure a favourable outcome. After converting the schematic into PCB, a laser jet printer was used in the printing of the converted design into a special material known as Press and Peel sheet, a transparent film used in PCB production. IV. RESULTS AND DISCUSSIONS The binary to decimal and all the algorithm conversions and counting are implemented in the firmware of PIC16F628. The result is finally displayed on the Dual Seven Segment LED display. The software was compiled with the mikroC Pro for PIC compiler from mikroElektronika. The firmware was compiled into a machine code using the same Editor, and programmed into the microcontroller. The simulation of the algorithm of the detector system was done using Proteus software from Lab Center Electronics. Figure 5 shows the constructed circuit. Fig. 5: The constructed 4-bit binary counter The following results were obtained at each count pulse. Table 10: Counter output obtained at each count pulse Pulse No/ SSD LED 1 LED 2 LED 3 LED 4 0 0 0 0 0 1 0 0 0 1 2 0 0 1 0 3 0 0 1 1 4 0 1 0 0 5 0 1 0 1 6 0 1 1 0 7 0 1 1 1 8 1 0 0 0
  • 5. Design, Construction and Operation of A 4-Bit Counting Circuit DOI: 10.9790/2834-10137378 www.iosrjournals.org 77 | Page 9 1 0 0 1 10 1 0 1 0 11 1 0 1 1 12 1 1 0 0 13 1 1 0 1 14 1 1 1 0 15 1 1 1 1 4.1 Mode of operation of the counter A multiplex dual 7-segment display was employed in order to display the binary equivalent that is generated at a time. The Microcontroller used in the design is a type PIC16F628. This is one of the most recent Microcontrollers and has a built-in oscillator and can be reprogrammed. The reset pin (4) of the microcontroller is made positive by the 10KΩ pull-up resistor and a switch in order for the PIC to function properly. If the counter is to be reset, the switch can be pressed, pulling pin 4 to 0V for a moment. The “trigger reaction” signal from the push button is fed to the pin RA1 of the microcontroller. The 10KΩ resistors pull these inputs to +5V and 0V when the push button is pressed, in which case the appropriate input is made negative (logic 0). The LEDs are driven from the microcontroller pins RA0, RA2, RA3 and RA4, respectively, via 10KΩ pull-up resistors. Pins RB0, RB1, RB2 and RB3 provide a Binary Coded Decimal (BCD) output equivalent to the number that will be displayed on the Seven Segment Display. This binary is converted to a seven-segment output by the microcontroller and the outputs to the dual seven segment display are delivered from pins RB0 to RB7 via 330Ω current limiting resistors. The complete circuit diagram for the 4-Bit Binary Counter is shown in figure 4. There is insufficient power from the microcontroller to drive the dual displays, and in any case, it is customary to use “strobes” (multiplexing) to drive two displays from one set of segment outputs. Virtually all displays are driven in this way. This explains why calculators and other digital electronic devices often appear to flicker when filmed with a video camera. Strobe is achieved by careful programming, and the use of microcontroller pin RA7 and RA8 to control which display is lit at any one time. When RA7 and RA8 are at logic 1, current flows through the 10kΩ current limiting resistor into the base of the two transistors. Hence the transistor switches on, and their collectors are effectively pulled to 0V, via their emitters. The collectors of the transistors are connected to the display common cathode Pins and so the display is able to light up according to the binary coded output. However, when RA7 and RA8 are at logic 0 (0V), the two transistors turned off, and so no current will flow to the display and hence the display stays off. Decoupling of the supply is provided by electrolytic capacitors and a 9V PP3 battery provides the necessary power supply. Fig. 4: Schematic Layout of the 4-Bit Binary Counter 4.2 Applications of the circuit The designed and constructed 4-bits counter can find application in the following areas: (1) It is used essentially in digital computers and other digital devices for memory storage and counting in different bases. (2) The binary counting circuit can be modified and used in radioactivity Rate Meter for count rate per record. (3) It can be modified and applied in frequency-dividing operations. (4) It can be used in digital clocks and timers for counting events.
  • 6. Design, Construction and Operation of A 4-Bit Counting Circuit DOI: 10.9790/2834-10137378 www.iosrjournals.org 78 | Page V. CONCLUSION Digital counting circuits are vital in everyday Electronics. They are used not only in counting, but in the conversion from one number base to another. Although, counters can also be designed/constructed using multi- vibrators, this research has used the PIC Microcontroller, showing that it is the best method, as it makes use of a firmware for its operation, at the same time reducing the number of components in the circuit. Again, the chip could be reprogrammed for the realization of other types of counters. REFERENCES [1]. Menkiti, A.I. Computer Logic and Architecture. University of Calabar Press, Calabar, Nigeria, 2011. [2]. Bozie, S.M. Electronics and switching circuits. Edward Arnold Publication, London, 1979. [3]. Givant, S. and Halmos, P. Introduction to Boolean Algebra. Undergraduate Text in Mathematics, Sprinter Pub., 2009. [4]. Hill, J.F. and Peterson, G.R. Introduction to switching theory and logical design. John Wiley and Sons, New York, 1974. [5]. Patton, A. An introduction to digital logic. Macmillan Books, London, 1973. [6]. Mandll, M. Directory of electronics circuits with glossary of terms. Eaglewood Cliffs, New Jersey, 1978. [7]. Jaegar, R. C. Microelectronics circuit design. McGraw Hill. pp.226-233, 1997 [8]. Haykinl, S.S. Transistor circuits in electronics. Liffer Books, London, 1971.