Computer Systems And Architectures

Physical components of a computer system - all computers have this structure.

von-neumann.gif

History of the CPU

The CPU is the heart and soul of a computer.

1st generation (late 1940s) - CPU consisted of vacuum tubes, capacitors, resistors. Its speed measured in milliseconds (one thousandth of a second).

2nd generation (during 1950s) - CPU consisted of transistors. Its speed measured in microseconds (one millionth of a second).

3rd generation (mid 1960s) - Minicomputers - CPU now consists of integrated circuits containing complete logic circuits, which could be made using automated production (machines). CPU speed measured in nanoseconds (one billionth of a second).

4th generation (late 1970s) - Microcomputers - Very large scale integration of logic circuits. The computers we know today. CPU speed measured in picoseconds (one trillionth of a second).

5th generation … project started in Japan in late 1980s but abandoned in the early 1990s.

PS3 article

Input Devices

For 1st generation computers, input units were punch cards and paper tape…

Examples of modern input devices

Keyboard
Mouse
Microphone
Joystick
Scanner
Webcam
Graphics tablet

Output Devices

Examples of modern output devices

Monitor
Speakers
Printer
Projector
Plotter
Headphones

***A modem or router is both an input and output device

Storage

Storage is either Main Memory (RAM/ROM), or Auxiliary Memory

Examples of modern storage devices

CD, DVD
Flash drive
USB stick
Floppy Disc
Hard Disc Drive


The CPU

How does the CPU work?

The CPU works in binary using binary digits - bits. We represent them with 1s and 0s, to the CPU it's a presence (1) or absence (0) of an electrical current in a logic circuit.

There are 8 bits in a byte.

Half a byte (4 bits) is called a nibble.

Some CPUs may process 2, 4 or even 8 bits at a time. The number of bits processed at a time is called a word.

Inside the CPU are millions of logic gates, which use Boolean logic (that is, only two possible answers). In our tutorials we used the example of Male and Female, however this is not technically correct as it is possible for something to be neither, or even both (but let's not go there). A better example is Male and NOT Male. This way we get only two possible answers. Computers use boolean logic all the time - on/off, true/false, current/no current, 1/0… When we begin programming, you will see how essential this is when we look at creating conditions and the IF statement.


Basic types of logic gates

We can represent the logic gates in an integrated circuit using the pictures below. Each one represents a variation in the way the logic gate is imprinted on the circuit. Remember, 1 means current, 0 means no current. Where the output is 0, the logic gate stops the electrical current from continuing in that part of the circuit.


AND gate

ANDgate.gif

truth table for AND gate:

A B A AND B
0 0 0
0 1 0
1 0 0
1 1 1

In other words, only if the values of both A and B are 1, then the output A AND B (we can also write it as A ^ B) will be 1.


OR gate

ORgate.GIF

truth table for OR gate:

A B A OR B
0 0 0
0 1 1
1 0 1
1 1 1

In other words, if either of the values of A and B are 1 (this includes if they are both 1), then the output A OR B (we can also write it as A v B) will be 1.


NOT gate

NOTgate.GIF

truth table for NOT gate:

A NOT A
0 1
1 0

In other words, the output NOT A (we can also write this as - A) is the opposite of the input A. The NOT logic gate reverses the input.


CPUs work by combining millions of these logic gates.


Here is a simple example:

logic1.gif

Step 1: Inputs A and B go through an OR gate, and then the output is reversed by the NOT gate.
Step 2: Inputs C and D go through an AND gate.
Step 3: The outputs of steps 1 and 2 above go through an AND gate to give us our final output.

Let's say the inputs are A=0, B=0, C=0, D=0.
Step 1: the inputs for the OR gate are 0 and 0. Looking at our OR truth table, where both inputs are 0, the output is 0. This is reversed by the NOT gate to 1.
Step 2: the inputs for the AND gate are 0 and 0. Looking at our AND truth table, where both inputs are 0, the output is 0.
Step 3. the inputs for the next AND gate are 1 (from step 1) and 0 (from step 2). Looking at our AND truth table, where only one input is 1, the output is 0, therefore our final output is 0.

Try these inputs:
a) A=1, B=1, C=1, D=1
b) A=1, B=0, C=1, D=0
c) A=1, B=1, C=0, D=0
d) A=0, B=0, C=1, D=1

Your outputs should be
a) 0
b) 0
c) 0
d) 1

Now, complete the entire truth table for the above circuit (a circuit is a combination of logic gates). To make it easier, I've added columns for the outputs of the logic gates A OR B, C AND D, and NOT (A OR B). Note that I've used the simple notation of ^ for AND, v for OR and - for NOT.

A B C D A v B C ^ D - (A v B) - (A v B) ^ (C ^ D)
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 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

(don't be scared by the last column, it represents the combination of outputs of the other gates)


Ok, now here's a more complicated one.

logic2.gif

I won't do the entire truth table here (all 256 possible combinations) but I'll give you some to test. Complete the output column.

A B C D E F G H output
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1
1 0 1 0 1 0 0 0
1 1 0 1 1 1 0 1
0 0 1 0 0 0 0 1
0 0 1 1 0 0 1 1
1 0 0 1 1 0 1 0
1 1 1 1 1 1 1 1

My answers are (from top to bottom):

output
1
1
1
0
1
1
1
0

How did you go?


If you are interested in this sort of thing there are other more advanced gates (NOR, NAND, XOR, XNOR), check out this link


More CPU Architecture stuff

This diagram is a basic model of what makes up a CPU (inside the red box).

cpu.GIF

A summary of the tasks that each part of the CPU performs:

  • Input/Output Unit controls the flow of information between the processor and the rest of the computer.
  • Control Unit directs the operations. It Reads, Decodes and Executes (by activating circuits) instructions (this is called the Fetch—>Execute cycle).
  • ALU (arithmetic and logic unit) carries out instructions from the control unit.
  • Level 1 cache is a small, very fast memory, for immediate use by the processor.
  • FPU (floating point unit, or maths co-processor) is a part of the ALU and carries out complex mathematical operations.
  • Accumulators, registers and buffers (not shown, but still exist) hold data temporarily.

Remember, if humans were computers, the Control Unit would be your brain, the ALU would be your liver and stomach, the Input/Output system would be your senses and voice, the cache would be like a notepad and the FPU a calculator.

These next few paragraphs are straight out of the textbook - they were read aloud in class.

The operations of the processor (and hence all parts of the computer) are synchronised by a timing device called the system clock. Data is read from memory, instructions are passed to the control unit and calculations carried out in the ALU all on an electromagnetic pulse from the clock. These activities must be coordinated so that the different operations keep in step with each other. The clock will be set to operate at a speed such as 800MHz (800 million vibrations per second). The faster the clock is set, the quicker the computer can carry out required tasks.

On a PC the processor is contained on a silicon chip and has the equivalent of many millions of transistors in an area not much larger than your fingernail. The chip consists of microscopic layers of silicon, the circuits of which are made by etching or depositing different materials such as aluminium or chemically impure silicon. The lines of the circuits on the chip are so small that one hundred lines are less than 1mm wide. Chips are now being produced with the equivalent of 40+ million transistors on each.

Because of the complexity and level of miniaturisation these processors are extremely expensive to design and develop. However, once production is underway they can be manufactured in the thousands. When development costs have been met, the cost of each processor soon drops. The three current main producers of processor for PCs are Intel and AMD for Windows computers, and Motorola for Macintosh computers.

The processor is mounted on a motherboard - a rectangular circuit board that links all of the components inside the computer. The connections are made through pathways called the system bus. The speed of the system bus (eg 100 or 133MHz) affects the rate at which data can pass between the components and hence the speed operations can occur at.

Increasing demands are being placed on processors and memory nowadays. Multimedia computing for example calls for the manipulation of blobs (binary large objects, eg video images or sound files) which require very fast and complex processing. This demand seems to be following a spiral pattern. As processors become more powerful users find applications that push them to their limit so that more powerful processors need to be developed. The expectations of users and the more sophisticated applications being produced lead to a rapid obsolescence in processors.

End of textbook stuff

Sure, we've created faster processors that are getting smaller and smaller, but we are reaching the limits of miniaturisation of processors. How can we get faster using this same computer model? The problem is that this traditional model of a computer, the von Neumann model, has one major limitation, and that is that instructions and memory must travel the same path (bus) and that pipelining (reading the next instruction while passing the results of the previous instruction) is not possible. This problem is called the von Neumann bottleneck. Alternative architectures to overcome this problem have been suggested or are already in operation:

  • distributed systems - where processors at a variety of sites share tasks
  • parallel processing - more than one processor in the one computer (eg dual core Intel processors)
  • clustering - a group of independent computers is managed as a single system
  • reduced instruction set computer (RISC) processors with a Harvard architecture - data and instructions travel on multiple buses (paths) at the same time
  • artifical neural networks (ANNs) that mimic the operations of neurons in the human brain (see http://en.wikipedia.org/wiki/Artificial_neural_network)

Working in Binary

Now we'll look at how the CPU converts our numbers (decimal- base 10) into its numbers (binary - base 2) and back.

First, converting binary to decimal

Starting from the right, each binary digit represents a power of 2: 20 (1), 21 (2), 22 (4), 23 (8) etc. You need to keep going for as many binary digits that you have.

Then add all of the powers of 2 that have a 1 in their column, and omit all those with a 0 in their column.

Example. Convert 1012 to decimal.

It might help to draw up a table:

22 21 20
powers of 2 4 2 1
binary number 1 0 1
count? Y N Y

So our total is 4 (22) + 0 (21) + 1 (20), which is 5. Therefore, 1012 = 510.

Obviously, computers will work with much larger binary numbers. It's simply a matter of adding more powers of 2 to your table.

We use powers of 2, because there are two unique digits in binary. In decimal, which has 10 unique digits - 0123456789 - we use powers of 10. In Hexadecimal, which has 16 unique digits - 0123456789ABCDEF - we use powers of 16. Feel free to investigate that on your own… (try these links: http://www.hotkey.net.au/~brain/cabhelp/comphelp/factnumsys.htm, http://vlaurie.com/computers2/Articles/hexed.htm, http://www.pc-control.co.uk/hexadecimal_number_system.htm). If you can add, subtract and multiply hexadecimal numbers without stressing yourself out then more power to you.

Back to binary - here's another example: convert 101010112 to decimal.

27 26 25 24 23 22 21 20
powers of 2 128 64 32 16 8 4 2 1
binary number 1 0 1 0 1 0 1 1
count? Y N Y N Y N Y Y

So our total is 128 + 0 + 32 + 0 + 8 + 0 + 2 + 1, which equals 17110.

Your turn. Convert these binary numbers to decimal.

a) 112
b) 1102
c) 11012
d) 1010112
e) 111100112

Now, converting decimal to binary

Essentially we do the reverse - start from the highest power of 2 that is smaller than or equal to our decimal number.
If we work backwards from there and deduct each power of 2 from the remainder, each of the powers of two will fit into the decimal number either once or no times - this is where we get our 1s and 0s in our binary number.

Example. Convert 1310 to binary.

Working backwards in our powers of 2.

Is 16 (24 smaller than or equal to 13? No. We keep going until we get a yes.

Is 8 smaller than or equal to 13? Yes. So we start with a 1 in the 23 column. (So far our binary number is 1 _ _ _.)

Deduct 8 from 13, giving us a remainder of 5. Continue with the remaining powers of 2.

Is 4 smaller than or equal to 5? Yes. So the next digit is a 1. (So far our binary number is 1 1 _ _.)

5 - 4 = 1, so our remainder is 1.

Is 2 smaller than or equal to 1? No. So the next digit is a 0. We don't just skip it, we must put a 0. (So far our binary number is 1 1 0 _.)

Is 1 smaller than or equal to 1? Yes. So the final digit is a 1. (Our binary number is 1 1 0 1.)

1 - 1 = 0, which should be the remainder after the last column. If you still have any remainder then you've made a mistake somewhere.

Here's the table:

24 23 22 21 20
powers of 2 16 8 4 2 1
binary number 0 1 1 0 1

Any leading 0s (if we have a 0 before the first 1 in a number, like here in the 24 column) can be discarded.

Check your answer by adding up all the columns that have a 1 in the binary number. 8 + 4 + 1 = 13, which equals our decimal number. So 1310 is 11012.

Here's another example, just the table this time.

Convert 21510 to binary.

27 26 25 24 23 22 21 20
powers of 2 128 64 32 16 8 4 2 1
binary number 1 1 0 1 0 1 1 1

Check your answer: 128 + 64 + 16 + 4 + 2 + 1 = 215, which equals our decimal number. So 21510 is 110101112.

Your turn. Convert these decimal numbers to binary.

a) 310
b) 1110
c) 2410
d) 10010
e) 25510
f) 101910

So that's converting between decimal and binary.

Adding binary numbers

All of this converting is pretty useless to us if the computer couldn't actually add, so let's see how computers add (in binary, of course).

When we add larger numbers in decimal, we are taught to go from right to left.

For example, 23 + 35:

first number 2 3
second number 3 5 +
result 5 8

(going from right to left: 3+5=8; 2+3=5).

But when our numbers add up to 10 or more, we must carry the tens column. Eg, 25+37:

first number 2 5
second number 13 7 +
result 6 2

(going from right to left: 5+7=12, write 2, carry 1 into the next column; 2+3+1=6)

In Binary, we add up the same way.

first number 1 0 1 1 0
second number 1 0 0 1 +
result 1 1 1 1 1

Going from right to left, 0+1=1, 1+0=1, 1+0=1, 0+1=1, 1+nothing=1, so our answer is 11111.

If we must ever add 1+1, because we can't write a 2 we must write the binary equivalent (10). So we write the 0 and carry the 1 into the next column.

first number 1 0 1 1 0
second number 1 1 10 1 0 0 +
result 1 0 1 0 1 0

So what do we do if we carry a 1 into a sum with two 1s already? 1 + 1 + 1 is 3, which is 11 in binary. Write a 1 and carry a 1 into the next column.

first number 1 0 1 1 1 0 1
second number 1 11 11 11 10 11 11 1 +
result 1 1 0 1 0 1 0 0

A computer uses two simultaneous logic gates (called a 'half adder') to perform this addition. The first outputs the sum, the second outputs the carry into the next adder. To add 1 + 1 + 1, it combines half-adders to create a 'full adder' which allow for the three inputs (including a carry from the previous adder). These adders use an XOR gate (exclusive-OR, same as OR except if both inputs are 1 the output is 0) as well as AND and OR gates.

Try these examples on our own:

a) 100 + 11
b) 101 + 110
c) 101 + 101
d) 10101 + 1111
e) 10101101 + 11001111

That's it for binary.

Memory, followed by Types of Computer

For the memory stuff, I've simply included a scan of the pages in the text because they are a great source of information. I summarised in this document. The Types of Computer section is also included in the above scan.

Memory Measurement summary

Unit name Abbreviation Size example of use
binary digit bit 1 bit an integrated circuit
byte B 8 bits a memory register
kilobyte KB 1024 bytes 5.25 inch floppy disc 360 KB
megabyte MB 1024 KB CD 800 MB
gigabyte GB 1024 MB DVD 4-9 GB or blue-ray disc 50 GB
terabyte TB 1024 GB newer Hard Disc Drives 1 TB and greater
Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License