[go: up one dir, main page]

0% found this document useful (0 votes)
37 views15 pages

4-Bit Computer - Waiting For Friday

The document discusses the fundamentals of binary counting and logic gates, explaining how to build a simple 4-bit computer using transistors. It covers the principles of binary addition, the construction of half-adders and full-adders, and provides circuit diagrams for building the computer. Additionally, it offers resources for readers interested in creating their own computer from scratch.

Uploaded by

Alexander Silva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views15 pages

4-Bit Computer - Waiting For Friday

The document discusses the fundamentals of binary counting and logic gates, explaining how to build a simple 4-bit computer using transistors. It covers the principles of binary addition, the construction of half-adders and full-adders, and provides circuit diagrams for building the computer. Additionally, it offers resources for readers interested in creating their own computer from scratch.

Uploaded by

Alexander Silva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

12/01/2025, 12:09 4-Bit Computer – Waiting for Friday

Home AVR Microcontroller PIC Microcontroller Retro Computers About Links Sitemap Login/Register

4-Bit Computer Search here

Posted by Simon Inns Posted on January 30, 2010 Retro Computers 25 Comments.
Donate to
Contents [hide]
waitingforfriday.com

If you like this site and want to


If you’ve ever wondered how electronic devices like computers can count, this article gives a simple support future projects, or you
to show appreciation for a proj
introduction to binary and logic and shows how they are tied together with electronics to make both simple
built, used or enjoyed, please c
and complex computers. leaving a PayPal donation. It’s q
secure and helps us to run the
fund future projects!
Making your own 4 bit computer from transistors

Recent Posts

Acorn BBC Master and Elec


Cartridge Breakout

SmallyMouse2 – Universal
Quadrature Mouse Adapter

60W Acorn BBC Master po


supply upgrade

A new look for the website!

USB to Quadrature Mouse A

Please note: There are a couple of mistakes on the slides in the youtube video which are shown corrected
below. Thanks to reader [Veini] for taking the time to review the logic diagrams!

Fundamentals of binary counting


To begin with let’s have a look at some fundamentals. Since digital computers can only represent two states,
on and off or zero and one, there are only two numbers available; therefore they have to count in base 2, not
base 10 as we would do. However, it’s very similar, instead of ones, tens, hundreds and thousands, base 2
counts in ones, twos, fours, eights and so on. So, for example 2 in base 10 is one- zero in base 2.

https://www.waitingforfriday.com/?p=529 1/15
12/01/2025, 12:09 4-Bit Computer – Waiting for Friday

Counting in Binary

When we add numbers in base ten we carry over any digits which are greater than 9 into the next magnitude
of units, so nine plus one equals zero carry one, or ten.

Addition in Base 10

Binary works exactly the same, however you carry over if the result is greater than 1, so one plus one equals
one-zero.

https://www.waitingforfriday.com/?p=529 2/15
12/01/2025, 12:09 4-Bit Computer – Waiting for Friday

Addition in Base 2

This means that if you have two single-figure binary numbers and you add them together there are only 4
possible results.

4 Possible results

It is useful to represent this in what’s known as a truth table. Here you can see the 4 possible values of the
inputs A and B, and the four possible outputs represented by Sum and Carry.

https://www.waitingforfriday.com/?p=529 3/15
12/01/2025, 12:09 4-Bit Computer – Waiting for Friday

4 Possible result in a truth table

In order to represent the ‘logic’ required to get from the possible range of inputs to the desired outputs we
use Boolean operations, or as they are more commonly called in electronics, logic gates.

Logic Gates
Here are the three basic types of logic gates which I’ve chosen because they are the simplest gates to make
from transistors. You can make all other types of gates by combining these three.

Basic Boolean operations

An AND gate outputs one only when both its inputs are one. An OR gate outputs one when either input is
one. Finally a NOT gate (or inverter as it is sometimes called) outputs the opposite of its input, so if the input
is one the output is zero and vice-versa.

So, going back to our truth table, let’s look at the logic required to get ‘Sum’ based on the inputs A and B. Here
we want the logic to output one only when one input is one and not the other, this is known as an exclusive
OR gate. We can do this by simply using two AND gates with NOT gates on opposing inputs. If either gate
outputs a 1 the result is 1 via the final OR gate.

https://www.waitingforfriday.com/?p=529 4/15
12/01/2025, 12:09 4-Bit Computer – Waiting for Friday

4 possible results – Sum logic

The carry output is even simpler, we want the carry to be 1 if both A and B is one, so we use an AND gate.

4 possible results – Carry logic

To get the whole truth table we simply add the two logic circuits together. This logic is called a ‘half-adder’
due to the fact that it is only capable of working on single bit numbers, since you cannot input the carry bit,
you can’t cascade them together to work on larger binary numbers.

https://www.waitingforfriday.com/?p=529 5/15
12/01/2025, 12:09 4-Bit Computer – Waiting for Friday

The half-adder

To solve this we combine two half-adders together to make a full-adder. This logic takes A, B and a carry as
input and outputs the sum and carry. If you followed along with the half adder it’s pretty easy to see how this
works from the logic diagram.

The full-adder

Now the simple full-adder logic circuits can be combined to allow bigger binary numbers to be added
together. This picture shows a four bit adder, in fact, due to the way the carry bit ‘ripples’ down, this is known
as a ripple carry adder. Since both the A and B inputs are now 4 bits we can add together 1111 and 1111 or
15 plus 15 in base 10 to get a five bit result.

https://www.waitingforfriday.com/?p=529 6/15
12/01/2025, 12:09 4-Bit Computer – Waiting for Friday

A 4-bit adder

Building logic gates from transistors


Now let’s take a quick look at how we build logic gates using transistors. First up is the NOT gate. Here if the
input is 1 it causes the electricity to flow from the collector to the emitter (top to bottom). Since the
electricity will always follow the path of least resistance the output will be zero. If the input is zero, the
transistor prevents the flow from collector to emitter, so the electricity flows out of the output causing it to
be one.

Transistor NOT gate

Next up is the AND gate. This requires two transistors, the inputs are on the bases and only if both inputs are
one can the electricity flow to the output, making it a one also.

https://www.waitingforfriday.com/?p=529 7/15
12/01/2025, 12:09 4-Bit Computer – Waiting for Friday

Transistor AND gate

The OR gate is similar but has two possible paths for the electricity, so if one base or the other is one,
electricity flows to the output.

Transistor OR gate

Building a full-adder
Once you have these basic building blocks you can combine them together using the logic diagram for a full
adder, which gives us this circuit diagram:

https://www.waitingforfriday.com/?p=529 8/15
12/01/2025, 12:09 4-Bit Computer – Waiting for Friday

Full-adder circuit schematic

Here you can see a picture of a completed full-adder, the A, B and carry inputs are on the left and the sum and
carry outputs are on the right. By making more of these it is possible to build adders capable of dealing with
bigger and bigger numbers.

Picture of a full-adder circuit

Building a computer
So with all the theory out of the way, let’s look at a real 4-bit computer built from discrete transistor gates.
This circuit has 4 switches for each input (A and B) and a simple five LED output showing the result. Note that
both the inputs and the output are little-endian meaning the smallest binary value is on the right, just like in
base 10. You can clearly see the 4 full-adder circuits which perform the processing.

https://www.waitingforfriday.com/?p=529 9/15
12/01/2025, 12:09 4-Bit Computer – Waiting for Friday

A 4-bit computer made from transistors

The computer is made by combining 4 full adder circuits (as shown above) and some extra circuitry which
drives the inputs to the adders and displays the output:

4-bit computer input and output circuit schematics

Conclusion
And there you have it, how a simple transistor can be made to count. Whilst this ‘computer’ is a very basic
one, you can easily see why modern processors contain hundreds of millions of transistors which enable
modern computers to perform so much logic at such amazing speeds.

Build your own computer


If you’re crazy enough to want to build you own computer from scratch (well, I was!) you can download the
schematics and the PCB artwork used in this article:

4bit_Computer_schematics

https://www.waitingforfriday.com/?p=529 10/15
12/01/2025, 12:09 4-Bit Computer – Waiting for Friday

← Previous Post Next Post →

25 Responsesso far.

sergey says:
February 27, 2017 at 2:25 pm

Hi,

Could you please say, what program and what version of the program did you use to create
shematics? I could not open it. Thank you.
LOG IN TO REPLY

Simon Inns says:


February 27, 2017 at 6:50 pm

The software was called ExpressPCB (you can find it via Google quite easily).
LOG IN TO REPLY

sergey says:
February 28, 2017 at 2:25 pm

Works. I was able to open it. Great video and tutorial! Everything is clear and easy to
understand. Thank you very much!
LOG IN TO REPLY

jpm290 says:
March 25, 2017 at 4:40 pm

Is this something that would be doable using toner transfer method to create the PCB at home? Or
is the schematic too complex for that? I’ve never tried making a PCB before, but this looks like a fun
project to try.
LOG IN TO REPLY

Simon Inns says:


March 25, 2017 at 5:10 pm

I made the board at home using UV transfer, so I imagine toner transfer should work just as
well. This might be a bit of a big PCB for a first try though… you’d probably be better off trying
a few smaller boards first.
LOG IN TO REPLY

sergey says:
April 8, 2017 at 12:55 pm

Hi,

I’m trying to make this 4-bits comp. but, I see on 4-bit computer input and output circuit schematics
+9 volt but on Full-adder circuit schematic I see +5 volts? What voltage do you use for your schem?
Could you please, explain this?
LOG IN TO REPLY

https://www.waitingforfriday.com/?p=529 11/15
12/01/2025, 12:09 4-Bit Computer – Waiting for Friday

Simon Inns says:


April 8, 2017 at 3:27 pm

It’s a mistake in the diagram. It should be powered from a 9V battery.


LOG IN TO REPLY

sergey says:
April 8, 2017 at 5:01 pm

Thank you!
LOG IN TO REPLY

KaePie says:
June 3, 2017 at 4:56 pm

Hi,

under which license is the adder released?

I would like to use and modify this for non-commercial use.

Thx. KaePie
LOG IN TO REPLY

Simon Inns says:


June 3, 2017 at 5:00 pm

You’re welcome to reuse the design KaePie, consider it covered under the creative commons
Attribution-ShareAlike (CC BY-SA) for your purposes.
LOG IN TO REPLY

KaePie says:
June 3, 2017 at 5:31 pm

Thank you.

I would like to build a simple 4-bit computer, which is very easy to understand.
The computer should only consist of transistors, resistors and diodes.
There are already a few of them, but they are didactically not so good.
There are building instructions, but they are not didactic enough.

Sorry for my poor english, I’am a native german speaker.


LOG IN TO REPLY

sergey says:
June 8, 2017 at 11:43 am

Hi Simon,

Thank you very much for your site and 4-Bit Computer schematics and detailed explanations! I did
my 4-Bit Computer, link for video with my model “https://youtu.be/WRGsdPUG2Gc” It was really

https://www.waitingforfriday.com/?p=529 12/15
12/01/2025, 12:09 4-Bit Computer – Waiting for Friday
educational.

Best regads,
Sergey.
LOG IN TO REPLY

ikastolero says:
October 5, 2017 at 7:00 pm

Great post. I was bored, so I designed a full substractor making a lot of karnaugh. Me and a friend
are thinking about making a small computer for basics operations, and well, I assume add and
substract are really basic, but I’m worried about multiply and divide. I need to think how to do it.

If we make it, I’ll send you photos lol.


LOG IN TO REPLY

Vojta Kutilek says:


May 26, 2019 at 1:35 pm

Hi, cool schemat.


I have one question: In logic gates you have resistors. Please tell me how much they have resistense
(Ohms).
Sorry for my englich.
LOG IN TO REPLY

Simon Inns says:


May 26, 2019 at 2:04 pm

The resistor values are in the more detailed schematics of the full adder; take a look there for
the answers.
LOG IN TO REPLY

sara says:
July 15, 2019 at 9:42 am

Hi Simon,

Which kind of switches did you use?


Is it spdt ?
LOG IN TO REPLY

Simon Inns says:


July 15, 2019 at 5:15 pm

Yes, they are simple ON-ON, SPDT switches I got from a local store; I believe they are pretty
common.
LOG IN TO REPLY

Matt says:
July 25, 2019 at 12:31 am

https://www.waitingforfriday.com/?p=529 13/15
12/01/2025, 12:09 4-Bit Computer – Waiting for Friday

Hi Simon,

I know this was posted a while ago, but could you please add the PCB layout for just the single Full-
Adder in PDF format? It would really help me out and save me some time.

Thanks,
Matt
LOG IN TO REPLY

Simon Inns says:


July 25, 2019 at 5:30 am

Hi Matt; I’m not really sure that I have the file stored; it’s been 9 years since I did the project I
will have a look though.
LOG IN TO REPLY

Ellipse says:
August 23, 2019 at 9:31 pm

Hi Simon, cool tutorial – thanks. I downloaded the 4bit_Computer_schematics file, but couldnt find
a software to open it with Mac. Any hints?
LOG IN TO REPLY

Simon Inns says:


August 24, 2019 at 4:55 am

The design was created (a long time ago) in ExpressSCH. You can google ExpressPCB to find it.
If there isn’t a Mac version then you will need to ask them about it as they wrote the software
not me
LOG IN TO REPLY

fede_ng says:
April 13, 2020 at 11:30 pm

Hi Simon, congratulations for this neat project. I would like to use one of the images as illustration
in a programming course book (the book is free and it is for a public university course). Would it be
possible? Best regards,
Federico
LOG IN TO REPLY

Simon Inns says:


April 14, 2020 at 3:43 am

I’d have no problem with that; glad you liked the project
LOG IN TO REPLY

Brayden Wegner says:


May 19, 2020 at 8:06 pm

https://www.waitingforfriday.com/?p=529 14/15
12/01/2025, 12:09 4-Bit Computer – Waiting for Friday

Hello! I was wondering if there was a parts list or building instructions?


LOG IN TO REPLY

Simon Inns says:


May 20, 2020 at 4:43 am

You should be able to generate the BoM using ExpressPCB – I realise that ExpressPCB is
(these days) a little obscure, but the project was published over 10 years ago now.
LOG IN TO REPLY

Leave a Reply

You must be logged in to post a comment.

Content is available under Attribution-


Noncommercial-No Derivative Works 4.0 Unported
unless otherwise noted. Follow us on Mastodon

Powered by WordPress | Rethink by InkThemes.

https://www.waitingforfriday.com/?p=529 15/15

You might also like