6. Computers
Many types of computers
embedded in robots roaming Mars
powering the navigational systems of nuclear
submarines
But all computers have the same
working principle as the first
computing model invented by
Von-Neumann in 1945.
9/27/2018
Dr.AtifShahzad
6
12. What Memory does to a Cell address?
9/27/2018
Dr.AtifShahzad
12
get its value,
or store a new
value.
13. What Memory does to a Cell address?
9/27/2018
Dr.AtifShahzad
13
The memory has a special input wire for
setting its operational mode:
14. Read Mode of Memory
In “read” mode, the memory retrieves
the byte stored in a cell, and outputs it
in eight data-transmitting wires:
9/27/2018
Dr.AtifShahzad
14
15. Read Mode of Memory
Reading the number
32 from memory
address 211
9/27/2018
Dr.AtifShahzad
15
16. Write Mode of Memory
When the memory is in “write” mode,
it gets a byte from these wires, and
writes it to the informed cell.
9/27/2018
Dr.AtifShahzad
16
17. Write Mode of Memory
Writing the number
33 in memory
address 212
9/27/2018
Dr.AtifShahzad
17
20. What is a Bus?
A group of wires used for transmitting
the same data is a bus .
9/27/2018
Dr.AtifShahzad
20
21. Address bus & Data bus
While the address bus is unidirectional
(only used to receive data), the data bus is
bidirectional (used to send and receive data).
9/27/2018
Dr.AtifShahzad
21
The eight wires used to transmit addresses
form the address bus .
The other eight wires used to transmit data to
and from memory cells form the data bus .
22. CPU & RAM interaction
9/27/2018
Dr.AtifShahzad
22
CPU and RAM are constantly exchanging data
24. What CPU can do?
simple mathematical operations (with
numbers stored in registers).
move data between the RAM and
registers.
9/27/2018
Dr.AtifShahzad
24
Copy data from memory position #220 into register #3,
Add the number in register #3 to the number in register #1.
25. Instruction set
The collection of all operations a CPU
can do is called its instruction set.
9/27/2018
Dr.AtifShahzad
25
Each operation in the instruction set is
assigned a number.
Computer code is essentially a sequence of
numbers representing CPU operations.
These operations are stored as numbers in the
RAM.
26. Fetch & Execute
The CPU works in a never-ending
cycle, always fetching and executing an
instruction from memory.
9/27/2018
Dr.AtifShahzad
26
27. Program Counter
At the core of this cycle is the PC
register, or Program Counter.
9/27/2018
Dr.AtifShahzad
27
It’s a special register that stores
the memory address of the next
instruction to be executed.
29. CPU Operation
When the CPU is powered up, the PC
is reset to its default value which is the
address of the first instruction to be
executed by the machine.
That’s usually an immutable built-in program
responsible for loading the computer’s basic
functionalities.
9/27/2018
Dr.AtifShahzad
29
30. Fetch-Execute
After being powered up, the CPU keeps
following fetch execute cycle until
the computer shuts down.
9/27/2018
Dr.AtifShahzad
30
31. Branching
But if the CPU could only follow an ordered,
sequential list of operations, it would be just a fancy
calculator.
it can be instructed to write a new value to the PC,
causing the execution to branch, or “jump” to
somewhere else in the memory.And this branching can
be conditional.
“set PC to address #200 if register #1 equals zero” .
9/27/2018
Dr.AtifShahzad
31