CS251 - Computer Organization
Computer Science 251
Computer Organization

Dickinson College
Fall Semester 1999
Grant Braught


Class #1 - Introduction




What is a computer?
A machine that can solve problems by following a set of instructions.

What are some of the main parts of a computer?
CPU, Memory, Disks, Monitor ...



Let's consider a simple computer...
       K&S Model 1 - Datapath Simulator

The Parts:
       Registers: Hold data values
       Knobs: Select addresses and operations
       ALU: Performs arithmetic and locical functions
       Switches: Make or break connections

Programming the K&S Model 1:
       Add register 0 to register 1 and put the result in register 3.
       Set the knobs and switches: ABus BBus ALU CBus CBus Address Address Operation Switch Address -------------------------------------------- R0 R1 A + B Closed R3        Click on "Run Cycle"

What is missing from this model?
Lots of things but very obviously... Memory (RAM)!
       RAM == Random Access Memory



Adding Memory to the K & S Computer:
       K&S Model 1 - Datapath Simulator w/ Main Memory

New Parts:
       Memory Addresses
       Main Memory Bus
       New Switches

Reading and Writing Memory:
       Reading memory:
            Select the memory cell to read
            Open switch from ALU
            Close switch from Main Memory Bus
            Close switch to registers
            Select Register to write
            Click on Run Cycle
       Writing memory:
            Homework Exercise: Not quite as straight forward as reading memory...

So what is missing from this model?
       Some obvious hardware - but lets think about functionality...

Can this computer be programmed?
Only one instruction at a time...
       That's not much of a program!



Adding Programmability to the K&S model 1:

What types of instructions do computers understand?
       Java?
       C++?
When you get right down to it they only understand 1's and 0's!

Ultimately, this class is all about how do computers do what they do while only really understanding 1's and 0's.

So how can we write a program for the K&S model 1?
Use patterns of 1's and 0's to express all of the knob and switch positions and also the selected memory cell...

One possible scheme is: Switch R0 R1 R2 R3 A+B A|B A&B A-B Open Closed MM0 MM1 MM2 MM3 etc... -------------------------------------------------------------------------- 00 01 10 11 00 01 10 11 0 1 0000 0001 0010 0011 Now would I write the instruction: MM[2] = R0 - R2
ABus BBus ALU Switch CBus MM Address Address Operation CTFA Address Address ----------------------------------------------------- 00 10 11 0101 00* 0010 * - this value is arbitrary. How would I compute R0 = MM[1] + R2?
This takes two steps:
       Move MM[1] into a register (R1)
       Add R1 to R2 and put the result into R0



Micro-Programming:
       K&S Model 1 - Datapath Simulator w/ Micro-programming

Write a micro-program to compute R0 = MM[1] + R2
       Step 1: R1 = MM[1] ABus BBus ALU Switch CBus MM Address Address Operation CTFA Address Address ----------------------------------------------------- 00* 00* 00* 1010 01 0001
       Step 2: R0 = R1 + R2 ABus BBus ALU Switch CBus MM Address Address Operation CTFA Address Address ----------------------------------------------------- 01 10 00 1001 00 0001* This is essentially how the first computers were programmed!
       Load Main Memory by setting switches.
       Load the program by setting switches .
       Hit the run button.
       Read results from memory by looking at lights.



Syllabus etc...
       Class webpage
       Syllabus is on-line - read it!