CENG 103
Introduction to Computer Engineering
Part III – Computer Architecture
Prof. Dr. Semih Bilgen
Istanbul Okan University
The Von Neumann Computer Architecture
The computer program is contained in the MEMORY.
The data is either contained in the memory or is obtained
from the INPUT devices.
The results of the program’s execution are provided by
the OUTPUT devices.
The order in which the instructions are carried out is
determined by the CONTROL UNIT.
MAR: Memory Address Register
MDR: Memory Data Register
ALU: Arithmetic Logic Unit
CPU: Central Processing Unit
TEMP: Temporary (fast) Storage in the CPU (REGISTERS)
PC: Program Counter
IR: Instruction Register
Memory Unit
A typical memory device (chip) today would have, e.g. 16GB capacity. This means 234
Bytes. (NOTE: A Byte is 8 bits)
(Also NOTE terminology: Kilo 210, Mega 220, Giga 230; so 16G 24 x 230 = 234)
Let’s assume that the word length on this device is 64 bits, i.e. 8 Bytes per word.
So, this 16 GB memory chip with Word Length = 8 Bytes (i.e. 23 Bytes, or 64 bits) would
consist of 231 words.
This means that any word on this chip will be selected by a 31-bit address.
Memory Unit (cont’d)
• To read from or write to any location (word) on this memory chip, the
CPU must place the address to be accessed in the MAR (31 bits), and
• either store the data (64 bits) to be written into memory in the MDR
(64 bits),
• or when the read operation is completed, the retrieved data will be
stored in the MDR.
• To read/write a word from/to memory, once the contents of the MAR
(and for writing, the MDR) are ready, the Control Unit will send an
«Enable» signal to the MEMORY device to transfer the contents of all
64 D-FF’s that store the 64 bit data in the addressed word to/from the
MDR.
Processing Unit (CPU)
Consists of logic circuits to carry out arithmetic (add, subtract, multiply,
divide, exponential) and logic (AND, OR, NOT, etc) on a full Word (64
bits in our example) of data that has been stored in one of its
REGISTERS. A register is a set of D-FF’s (in our example 64) with direct
connections to those logic circuits.
Many processors today have, on the CPU chip, CACHE memories that
will provide extra storage and very high access speeds, beside registers,
for temporary storage of arithmetic and logic operations.
Input/Output (I/O) devices
(a.k.a. peripherals)
• These are devices like keyboard, screen,microphone, loudspeaker,
earpods, printers, USB devices, external disks, internal disks, network
connections, IoT devices, etc. that provide interaction with users or
other devices, as well as long term external storage of data.
• Each device will have its own hardware interface to the Control Unit
and to the MEMORY, as well as a software («Driver SW») that will run
on the CPU to activate the control unit and manage the information
transfer to/from MEMORY. For any I/O unit to communicate with a
computer, the hardware connection must be correctly realized and
the driver software must be correctly working on the computer.
Control Unit
• Consists of the logic circuitry (many combinational and sequential circuits) that
keeps track of what the computer will do at each tick of the «clock», and provides
the necessary control signals to each device to realize the action to be carried out.
• To keep track of which instruction is being executed, the control unit has an
INSTRUCTION REGISTER (IR) to store that instruction.
• To keep track of which instruction is to be processed next, the control unit has a
register (PROGRAM COUNTER, PC) that contains the address of the next
instruction.
• The Control Unit is constructed so that when the computer is powered up, the first
one of the fixed set of instructions (called the «Bootstrap Program») in ROM is read
into the IR, it is executed, and then the Bootstrap Program is executed, instruction-
by-instruction, after which, typically the Operating System (which is the software
that governs how the computer will work) is activated.
• Fundamental principle of the Von Neumann Architecture: Programs (sequences of
instructions) and data are stored as bit strings in the memory, and a program is
executed one instruction at a time under the direction of the Control Unit.
Instruction processing
• Instructions are stored in memory words, just like data.
• Instructions may:
(a) operate on data (e.g. add, subtract, shift, logical operation, etc),
(b) move data (e.g. AB, etc),
(c) control program operation (e.g. branch, call a function, loop, etc).
• An instruction always has an OPCODE (operation code, or instruction code)
in the most significant (leftmost) bits, that indicates what exactly is to be
done.
• Depending on the specific instruction, the rest may contain the operand(s)
(that is, the data on which the operation will be performed), or more likely,
the address(es) of the operand(s).
Instruction processing (cont’d) –
«Instruction Cycle»
• Unless a control instruction is executed, the Control Unit simply:
1. Brings the instruction whose address is in the Program Counter from
memory into the IR («instruction fetch cycle»)
2. Decodes the OPCODE («decode cycle»)
3. Carries out the operation indicated by the OPCODE, possibly using the rest
of the instruction bits to obtain necessary data, («execute cycle»)
4. Increments the PC
5. Repeat from step 1.
• In case of a control instruction, step 3 simply modifies the PC as
directed by the instruction and skips step 4, continuing from step 5.