cs101 Lecture2
cs101 Lecture2
0 0 0 1 1 1 0 0 0 0
0 0 1 0 0 0 1 1 0 0
0 1 0 0 0 0 0 0 1 0
1 0 0 0 0 0 0 0 1 0
1 0 1 0 0 0 1 0 0 1
1 0 0 0 0 0 0 0 0 1
1 0 0 1 1 1 0 0 1 0
0 1 0 0 0 0 0 0 1 0
0 0 1 0 0 0 1 1 0 0
0 0 0 1 1 1 0 0 0 0
• ...
Coming back to: Does the picture
contain a Chameleon?
This question will need to be expressed as:
Gigabytes, Giga=230 4
5 1 0 1 1 1 1 0 1
Each byte in the memory is
6
assigned a distinct number, or
7
an address.
8
In a memory with N bytes, the
9
addresses go from 0 to N-1
Memory Ports
Memory has 3 ports: address port,
data port, control port.
Address port consists of log N
wires. (N = number of bytes in
memory)
You can place numbers 0..N-1 on
address port.
Control Port may be just 1 wire.
Wire = 0: Memory to perform read
operation.
Wire = 1: Memory to perform write
operation.
Data port will have w wires, where
w is a multiple of 8. Say w=8m.
Write Operation
Control Port must be set to 1.
If A is placed on the address
port, and D on data port, then
D will be stored in the m bytes
starting at byte A.
(Remember that the data port
had 8m wires, and so m bytes
are available on the data port)
Yes, it is possible to build
circuits that can do this!
Write Operation
10010
11101000
11101000
Read Write
Putting it together
Arthimetic 1. Now control unit
Unit
performs a read
0
1
operation of address
.. 100
10 57 100 200 300
...
100
100 289
2. The number 289
.... is sent to input 1 of
arithmetic unit
200 345 Bus
289 (network)
...
300
Control Unit
Memory
1 0
Read Write
Putting it together
Arthimetic 1. Now control unit
Unit
performs a read
0
1
operation of address
.. 200
10 57 100 200 300
...
200 2. The number 345
100 289
is sent to input 2 of
.... arithmetic unit
200 345 Bus
345 (network)
...
300
Control Unit
Memory
1 0
Read Write
Putting it together
Arthimetic 1. Now control unit
Unit
instructs the
0 99705
1
arithmetic unit to
.. x perform a multiply
10 57 100 200 300 operation (the
...
"control" wires are
100 289
set to the operation
.... code of "multiply")
200 345 Bus
(network)
2. Control unit
... stores the product
300 99705 (289 x 345 = 99705)
x Control Unit temporarily inside its
Memory own unit
0 0
Read Write
Putting it together
Arthimetic 1. Now control unit
Unit
performs a write
0
1
operation on
.. address 300
10 57 100 200 300
...
300 2. The number
100 289
99705 is sent on the
.... data port of memory
and 300 is sent on
200 345 Bus
99705
(network)
the address port of
... the memory
300 99705
Control Unit
Memory
0 1
Instruction
execution is
Read Write COMPLETE
Announcements
• Quiz: CS101:520
• Lab today: Check email for lab and JTA
assignment.
• Bugzilla
• Help session
– Some of you will get email for compulsory
attendance
– Others need advance sign up
Machine language program example
Example: