4 Bit Binary Synchronous Up Counter
4 Bit Binary Synchronous Up Counter
Instructor:
Bruce Kim
Submitted by:
Paniz Peiravani
Table of Contents
Section1: Executive Summary ......................................................................................... 3
Section 2: Introduction and Background ....................................................................... 3
Section 3: Electric Circuit Schematics ............................................................................ 6
Section 4: Detailed Electric Layouts ............................................................................. 10
Section 5: LTSPICE code and parasitic extractions with calculation analysis ......... 20
Section 6: IRSIM Logic Simulations and Measurements ........................................... 25
Section 7: Measurements in LTSPICE for delays ....................................................... 29
Section 8: Measurements of power, delay, chip area, timing, number of transistors
for the layout ................................................................................................................... 30
Power ........................................................................................................................ 30
Delay ......................................................................................................................... 30
Chip Area ................................................................................................................. 31
Timing ...................................................................................................................... 31
Numebr of transsitro for layout............................................................................. 32
Section 9: Pathwave ADS simulations for RC circuits ................................................ 33
Section 10: Conclusion .................................................................................................... 35
References ........................................................................................................................ 36
2|Page
4 Bit Binary Synchronous Up Counter Paniz Peiravani
3|Page
4 Bit Binary Synchronous Up Counter Paniz Peiravani
Before we started to design our 4bit JK F/F, we first needed to know the truth table of our
gates to be able to check the functionality of our design. Below you can see the truth table
for 3 input NAND and 2 input NAND gates.
A B C Output
0 0 0 1
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 0
A B Output
0 0 0
0 1 0
1 0 0
1 1 1
Once we designed our JK F/F, we will compare the IRSIM waveform for both schematic
and layout with JK F/F waveform to make sure our design works properly. You can see
both JK F/F waveform and truth table below in Figure 2.
Figure 2 - JK F/F waveform with preset and clear and truth table (Electrical4U, 2020)
4|Page
4 Bit Binary Synchronous Up Counter Paniz Peiravani
Once we designed our JK F/F and checked that our design worked properly, we started to
cascade our JK F/F to make our 4-bit Binary Synchronous Up Counter. As you can see
on Figure 3, to create our 4-bit JK F/F we needed 4 JK F/F and 2, two input AND gates.
Since we needed to have two input AND gate, we needed to know the truth table for the
AND gate first. You can see the truth table of the AND gate on Table 3.
A B Output
0 0 0
0 1 0
1 0 0
1 1 1
Once we designed our 4bit binary synchronous up counter, we checked our design by
comparing our LTSpice and IRSIM waveform to Figure 4 which is for 4bit binary
synchronous up counter timing diagram for JK F/F. As you can see closely on the
waveform, you can see the requirement is at timing should be at the rising edge.
5|Page
4 Bit Binary Synchronous Up Counter Paniz Peiravani
In Figure 5, you can see our schematic for two input NAND gate with DRC check.
In Figure 6, you can see our schematic for three input NAND gate with DRC check.
6|Page
4 Bit Binary Synchronous Up Counter Paniz Peiravani
In Figure 7, you can see our schematic for two input AND gate with DRC check.
In Figure 8, you can see our schematic for inverter with DRC check.
Figure 8 – Inverter
7|Page
4 Bit Binary Synchronous Up Counter Paniz Peiravani
Once we had our requirement gates, we started to design our JK F/F. As you can see on
Figure 9, we followed the design for JK F/F which you can see in Figure 1. For instance,
our JK F/F have 4 three input NAND gate, 4 two input NAND, and an inverter. We also
checked our design by checking DRC check.
Figure 9 - JK F/F
Once we had our JK F/F design, we started to design our JK F/F 4–bit binary
synchronous up counter. As you can see on Figure 10 and 11, we cascaded our JK F/F
design to make our design 4bit and added 2 two input AND gate to have final schematic
for 4bit synchronous up counter.
8|Page
4 Bit Binary Synchronous Up Counter Paniz Peiravani
Below you can see the closer look of our JK F/F 4bit binary synchronous up counter
design. For instance, Figure 12 shows the QA and QB of our design and Figure 13 shows
the QC and QD of our design.
9|Page
4 Bit Binary Synchronous Up Counter Paniz Peiravani
Once we had our completed design, we checked our design by using DRC check.
Figure 14 - DRC Check for 4bit JK F/F 4–bit binary synchronous up counter
On Figure 15, you can see our stick diagram and Euler’s path for two input AND gate.
After we drew our stick diagram, we designed our two input AND gate on the Electric
simulation and checked the DRC and Well Check to make sure our design worked
properly.
Figure 15 - Two Input AND Gate Stick Diagram and Euler’s Path
10 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
11 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
On Figure 18, you can see our stick diagram and Euler’s path for three input NAND gate.
After we drew our stick diagram, we designed our three input NAND gate on the Electric
simulation and checked the DRC and Well Check to make sure our design worked
properly.
12 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
On Figure 21, you can see our stick diagram and Euler’s path c for two input NAND
gate. After we drew our stick diagram, we designed our two input NAND gate on the
Electric simulation and checked the DRC and Well Check to make sure our design
worked properly.
13 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
14 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
Once we had our gates ready, we started to design our JK F/F. Below you can see the JK
F/F with DRC and Well Check.
Figure 24 - JK F/F
On Figure 25, we checked our JK F/F to make sure our design did not have any issue.
15 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
On Figure 26, you can see our JK F/F pass the well check as well.
Once we had our design for JK F/F with no error, we canscaded our design to get 4bit
synchrounous up counter JK F/F. We also needed to add 2 two input AND gate to our
desig based on the gate level diagram of the 4-bit synchronous up counter JK F/F.
Below on Figure 27, you can see our layout for 4-bit synchrounous up counter JK F/F.
16 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
To show you the more closer look of our layout, we took closer look picture of our
layout. You can see the closer look of our layout below.
17 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
18 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
Once we had our layout, we checked our design by checking DRC and Well check to
make sure our design does not have any errors.
On Figure 32, you can see our DRC check.
19 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
Once we had the Spice Code, we ran our LTSpice for the schematic. You can see our
schematic LTSpice on Figure 35. As you can see below, we have the correct waveform
starting from 0000 to 1111 and the timing is at the rising edge. QD is our Most
Significant Bit and QA is our Least Significant Bit.
1 0 1 01 01 0 10 1 01 0 1 0 1 0 10 10 1 01 0 1 0 1 0 1 01 0 1
1
1
1
1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
20 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
Below on Figure 36, you can see the Spice Code for our layout.
Once we had the Spice Code, we ran our LTSpice for the layout. You can see our
schematic LTSpice waveform in Figure 37. As you can see below, the counter started at
1111 due to the PRE initialization. We have the correct waveform starting from 0000 to
1111 and the timing is at the rising edge. QD is our Most Significant Bit and QA is our
Least Significant Bit.
0 10 1 0 1 01 0 1 01 0 1 01 0 1 01 0 1 0 1 0 1 0 1 0 1 01 0 1 01 0 1 01 0 1 01 0 1 01 0 1 01 0 1 01 0 1 01
1
01
1
1
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0
1 0 0 1 1 0 0 0 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 1 0
1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
0 1 0
1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1
0 1 0
Figure 37 - 4-bit Synchronous up counter LTSpice for Schematic
1111 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
21 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
Once we had our LTSpice and was sure that our waveform were correct, we started the
Parasitic Extraction for the layout. Our aim for the Parasitic extraction is to find the
PMOS Resistance (𝑅𝑃 ), NMOS Resistance (𝑅𝑁 ), Capacitor (C) of our 𝑉𝐼𝑁 and 𝑉𝑂𝑈𝑇 . For
instance, 𝑉𝐼𝑁 are CLK (clock), PRE (preset), CLR (clear) and our 𝑉𝑂𝑈𝑇 are QA, QB, QC,
and QD.
To get the Parasitic extraction first we need to change preference of our library. For
instance, we went to the properties => preference => Parasitic and turned Extract R,
Extract C, and Include Gate in Resistance on which you can see on Figure below.
22 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
On Figure 41, you can see the PMOS characteristics we got from Parasitic Extraction.
23 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
To find the capacitor for both 𝑉𝐼𝑁 and 𝑉𝑂𝑈𝑇 , we did the below methodology:
1. We copy the capacitor section in the Word documents to be able to use the search
feature.
2. We found the capacitor for each signal.
3. Calculate the sum of total capacitance for each signal. Since the capacitors are
more than likely to be in parallel, we added them all together.
24 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
To find the 𝑅𝑃 (PMOS resistor) and 𝑅𝑛 (NMOS resistor) for both 𝑉𝐼𝑁 and 𝑉𝑂𝑈𝑇 , we did
the below methodology:
1. Similar to methodology for capacitors, first we copy the resistor section in the
Word documents to be able to use the search feature.
2. First we need to find whether the resistor is connected to a PMOS or a NMOS to
know if should count it for Rp or Rn.
a. If it is connected to both PMOS and NMOS, then we applied it to
whichever is the source; for instance, left side connection is the source of
the resistor, and the right side is the destination.
b. If the source is something other than a PMOS or NMOS transistor
something like polysilicon, but the destination is a NMOS or PMOS, we
added the resistance to Rn or Rp since that NMOS or PMOS still shares
that resistance.
3. Finally, We calculated the sum of values for each signal. We also needed to check
if the transistor connects to is in parallel or series and added them accordingly.
Based on the Parasitic Extraction we found the following data for 𝑉𝐼𝑁 and 𝑉𝑂𝑈𝑇
25 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
On Figure 44, you can see the IRSIM for two input NAND gate for the schematic.
A 0 0 1 0 1
B 0 1 0 0 1
Out 1 1 1 1 0
Figure 44 - Two Input NAND Schematic
On Figure 45, you can see the IRSIM for three input NAND gate for the schematic.
A 0 0 0 0 1 1 1 1
B 0 0 1 1 0 0 1 1
C 0 1 0 1 0 1 0 1
Out 1 1 1 1 1 1 1 0
Figure 45 - Three Input NAND Schematic
On Figure 46, you can see the IRSIM for two input AND gate for the schematic.
A 0 1 0 1
B 0 0 1 1
Out 0 0 0 1
Figure 46 - Two Input AND Schematic
26 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
Once we checked our gate to mak sure that they were worked properly, we started to
design our JK F/F. Below you can see the IRSIM for JK F/F schematic and layout
waveform.
On Figure 47, you can see the IRSIM waveform for the JK F/F for schematic.
CLK 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Pre 0 1 0
CLR 0 1 0
J 0 1 0 1
K 0 1 0 1
Q 0 1 0 1
1 0 1 0
QBar
Figure 47 - JK F/F Schematic
On Figure 48, you can see the IRSIM waveform for the JK F/F for layout.
CLK 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Pre 0 1 0
CLR 0 1 0
J 0 1 0 1
K 0 1 0 1
Q 0 1 0 1
QBar 1 0 1 0
27 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
10 1 0 1 0 1 0 1 0 1 0 10 10 1 0 1 0 10 1 0 10 1 0 10 1 0 1 0
CLK
CLR 1
10
PRE 1
1
J
K 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
QA
0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
QB
0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0
QC
QD 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0
Figure 49 - 4-bit synchronous up counter JK F/F for schematic 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
On Figure 50, you can see the IRSIM for 4-bit synchronous up counter JK F/F for layout.
10 1 0 1 0 1 0 1 0 1 01 0 1 0 1 0 1 0 1 0 1 0 10 1 0 1 0 1 0 10
CLK
CLR 1
10
PRE 1
J 1
K 1
QA 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
QB 1 0 0 1 1 0 0 1 1 0 01 1 0 0 1 1
QC 1 0 0 0 0 1 1 1 10 0 0 0 1 1 1 1
QD 1 0 0 0 0 0 0 0 01 1 1 1 1 1 1 1
1111 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Figure 50 - 4-bit synchronous up counter JK F/F for layout
28 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
As you can see on Figrue 49 and Figure 50 from last page, which are IRSIM layout for
our 4-bit synchronous up counter JK F/F for our schematic and layout, the output
waveform worked perfectly and it counted form 1 “0000” to 15 “1111.
𝑇𝑃𝐻𝐿 + 𝑇𝑃𝐿𝐻
𝑇𝑃 =
2
We can find the fall time, rise time, TPHL, and TPLH by using proper Spice code. Below
you can find the Spice code for shcematic and layout that helped us to find the values.
Once we ran the code for our schematic, we can see the below values. We went to view
and then SPICE error log to saw the values.
29 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
Delay
To find the delay we added the TPHL and TPLH and then devide them by 2.
𝑇𝑃𝐻𝐿 + 𝑇𝑃𝐿𝐻
𝑇𝑃 =
2
Table 7 - Delay Table
As you can see the layout propagation delay is longer than schematic. Due to the physical
characteristics of the circuit being considered, the difference in the delays makes sense.
30 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
Chip Area
To find the chip area, first we needed to find the measurement of the layout which you
can see them below.
Width: 800.5 𝞴
Length: 2317.5 𝞴
140,087.5 𝑛𝑚
800.5 × 175 𝑛𝑚 = 140,087.5 𝑛𝑚 = = 140.0875 𝑢𝑚
1000 𝑢𝑚
40,5562.5 𝑛𝑚
2317.5 × 175 𝑛𝑚 = 40,5562.5 𝑛𝑚 = = 405.5625 𝑢𝑚
1000 𝑢𝑚
Timing
We could find the rise and fall times by using the values that we found in section 7 from our
Spice code. Below you can find the rise and the fall times:
As you can see the layout’s rise and fall times are much higher. Since the layout is close to a
real-world implementation than the schematic this difference is expected.
31 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
To find the number of transistors for the schematic we could go to Cell => Cell Info =>
Number of Transistors.
32 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
Once we could use the software, we started to design our JK F/F. First we design our JK
F/F.
33 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
Then we started to design our RC circuit. First, we search on how we can built our RC
circuit for our JK F/F. Below you can see the design that we found that we could used to
design our JK F/F.
Below you can see the our RC circuit for our 4bit synchrounous up counter JK F/F. To
design our RC circuit, we used the values for resistor and capacitors that we found from
the Parasitic extraction from our layout.
34 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
We were also able to run our design without facing any errors.
35 | P a g e
4 Bit Binary Synchronous Up Counter Paniz Peiravani
References
[1] W. Storr, “JK Flip Flop and the master-slave JK flip flop tutorial,” Basic Electronics
Tutorials, https://www.electronics-tutorials.ws/sequential/seq_2.html (accessed Apr. 8,
2024).
[2] S. Sinha, “NAND gate – the universal gate - electronics area,” Electronics Area –
Electrical and Electronics Tutorials and Circuits, https://electronicsarea.com/nand-gate-
truth-table/ (accessed Apr. 8, 2024).
[3] Electrical4U, “JK Flip Flop: What is it? (Truth Table & Timing Diagram),”
Electrical4U, https://www.electrical4u.com/jk-flip-flop/ (accessed Apr. 9, 2024).
[4] W. Storr, “Synchronous counter and Decade counter tutorial,” Basic Electronics
Tutorials, https://www.electronics-tutorials.ws/counter/count_3.html (accessed Apr. 12,
2024).
[5] S. Sinha, “Logic and gate – and truth table - electronics area,” Electronics Area -
Electrical and Electronics Tutorials and Circuits, https://electronicsarea.com/logic-and-
gate/ (accessed Apr. 12, 2024).
36 | P a g e