1. What is Digital in the first place?
Digit means number. Digital is kind of saying ‘All about numbers’, which is what happens behind the scenes. To understand the cyber world, first you must know what Base-2 is. Base-2 is the representation of numbers using 1s and 0s. In other words, the usual number 4 in Base-2 is 100 ( one, one and zero, not one hundred).
How is this possible? Well, this is the equivalent of saying (1 x 2 In power of 2) + (0 x 2 In power of 1) + (0 x 2 in power of 0). Note that every number in power of 0 equals 1 (2 in power of 0 = 1). So what is the product of the mentioned formula? The product is 4. This is how Base-2 works.
But why use Base-2? The answer is simple. In a digital circuit, 0 Volts represents digital ‘0′, and +5Volts represent digital ‘1′. If we can convert all numbers to ones and zeros, we can implement them in a circuit using Transistors.
However, before getting to transistors, we must first see what ‘Gates’ are.
2. Gates and their role in Digital
Digital circuits are created from small units known as Gates (like your body, which has its biological cells). We have 4 common gates: AND, OR, XOR and NOT. Gates usually have two inputs and one output (except NOT which has one input and one output).
Lets explain the AND gate. AND gate has 2 inputs and 1 output. If BOTH inputs are digital ‘1′, then the output will be digital ‘1′, otherwise (if both zero or one of the inputs zero), the output will be digital ‘0′ (thus is called the AND gate, meaning input 1 AND input 2 should be digital ‘1′).
The second gate will be the OR gate. OR gate has two inputs and one output. If at least one of the inputs is ‘1′, the output will be ‘1′ (thus named OR).
The third gate will be XOR. XOR is the extended version of OR. If ONLY 1 of the inputs is ‘1′, the output will be ‘1′, otherwise it will be ‘0′. (Both inputs ‘1′ or both ‘0′ will make a ‘0′ output).
The final gate will be NOT. This gate has 1 input and 1 output. The output is the reversed version of input. If you connect the input to digital ‘1′, the output will be ‘0′ and vice versa.
So, now that we know what gates are, lets make small digital adder! A digital addition is very simple. There are several rules to Follow:
0+0 = 0
0+1 = 1
1+0 = 1
1+1 = 0 and 1 in the next position (known as Carry bit).
The last one is a little different. 1+1 = 10 (0 is the answer, and 1 is called ‘Carry’). You might have already noticed, the addition is the gate XOR. 1 + 1 is the same as 1 XOR 1, since XOR does exactly that. The trick here is to detect when you have a Carry. If both inputs are 1, then you will have a Carry bit. To get the carry bit, we use an AND Gate.
Our adder is complete, now we have 2 inputs (the numbers) and two outputs ( one is the result, the other is the carry should it exist). This little circuit is called a HALF-ADDER. Why? Because it has two inputs, where it should have three.
You may ask why three? The third input is the CARRY bit of the PREVIOUS adder. Imagine you want to add 32bits number to another 32bits number. What you will need is thirty-two adders with their carry bits connected to each other.
Since each adder has a carry bit, the real circuit you should make is Input1 + Input2 + Carry. This will be too long to explain in a short article here, but you can Google it, and be sure you will find many tutorials on adders, half adders and the theory behind them.
Now that I explained how to create an ADDER in digital, you might have realized that the other operations are done using the same gates (Multiplication, Division, Subtraction, etc). Most people believe that these operations are done in software, never knowing that actually they are all done in hardware. It’s quite a fun life once you get used to it.
3. So now, what is a Transistor?
Transistor was the revolution in technology, and the very reason you can hold a mobile-phone in your hands or have a computer at your home. Transistor is the digital-cell; you can find several billion of them on a regular processor chip, the very same one you have on your computer now.
Now let me explain how it works. Of course, this will be the very basic transistor, as there are other cells used today which are more advanced (known as CMOS). A transistor has 3 leads: Collector, Base and Emitter.
If you apply power to Base (connecting it to +5V), then electricity can go from Collector to Emitter Assuming that collector is connected to a power supply). In fact, a transistor, in digital world, is a switch. Base is the key, and once you press it, collector and emitter are connected to each other; and of course once you release it, those two have no connection any more.
Now how does transistor help making world a better place? You can use transistor to create the gates I mentioned earlier. To create an AND gate, you need 3 transistors connected in the correct order. The OR gate needs three as well. The XOR gate needs more than 5, and the NOT gate needs only 1. For the half adder that you just learned how to create, we will need about 15 transistors, and you have your self a digital adder that can do something useful (Actually, it can add only 2 bits).
Now for 32 bits (commonly found in processors), you will need about 500 of them. This is the reason processors have many transistors. A simple Multiplier for 32 bits will need several thousands of them. You can now imagine complicated operations such as calculating Sine or Cosine will need several thousand transistors, and also memory blocks (known as FLIP-FLOP). The Flip-Flop is something I will explain in the second part of this tutorial.
I hope this article made things a little more clear to you. Remember the key to learning is doing research. If you are interested in this field, a book can be a very good place to start.
Source:http://www.booshnews.com/2010/06/29/what-are-some-of-the-disadvantages-of-overclocking-your-pc/