Lec 2,3
Lec 2,3
Lecture 1
Fundamental Concepts
What is Computer Architecture?
2
Why Study Computer
Architecture?
3
Why Study Computer Architecture?
◼ Enable better systems: make computers faster, cheaper,
smaller, more reliable, …
❑ By exploiting advances and changes in underlying technology/circuits
4
Computer Architecture Today
◼ Today is a very exciting time to study computer architecture
5
What is A Computer?
Three key components in computer system
◼ Computation
◼ Communication
◼ Storage (memory)
6
What is A Computer?
◼ We will cover all three components
Processing
control Memory
(sequencing) (program I/O System
and data)
datapath
7
What is a Computer System?
8
Levels of Representation
9
Levels of Abstraction
Graphical Interface
Application
Programming Application
Libraries
Operating System
System Programming
Programming Language
Assembler Language
Instruction Set Architecture - “Machine Language”
Processor IO System
Firmware Microprogramming
Datapath
Output
Bus Structures
13
14
15
16
Today, “Computers” are Connected Processors
Proc
Caches
Busses
adapters
Memory
Controllers
Disks
I/O Devices:
Displays Networks
Keyboards
19
21
22
23
24
Memory Words
25
26
What is A Computer?
◼ Central Processing Unit– CPU or Processor for short. The brain
of a computer. Approximately 1.5 in X 1.5 in. Does all the
computation/work for the computer.
27
28
29
What is A Computer?
◼ Memory– Although memory is technically any form of electronic
storage, it is used most often to identify fast, temporary forms of
storage. Accessing the hard drive for information takes time.
When the information is kept in memory, the CPU can access it
much more quickly.
30
Connection between processor and Main
Memory
32
What is A Computer?
◼ Random Access Memory– RAM. Where information is stored
temporarily when a program is run. Information is automatically
pulled into memory, we cannot control this. RAM is cleared
automatically when the computer is shutdown or rebooted. RAM
is volatile (non-permanent).
33
What is A Computer?
◼ Read Only Memory– ROM. More permanent than RAM. Data
stored in these chips is nonvolatile -- it is not lost when power is
removed. Data stored in these chips is either unchangeable or
requires a special operation to change. The BIOS is stored in the
CMOS, read-only memory.
34
What is A Computer?
◼ Hard Drive– Where you store information permanently most
frequently. This is also nonvolatile.
35
What is A Computer?
◼ Motherboard – A circuit board that allows the CPU to interact
with other parts of the computer.
36
What is A Computer?
Ports – Means of connecting peripheral devices to your computer.
◼ Serial Port – Often used to connect an older mice, older external modems,
older digital cameras, etc to the computer. The serial port has been replaced by
USB in most cases. 9-pin connector. Small and short, often gray in color.
Transmits data at 19 Kb/s.
◼ Monitor Ports – Used to connect a monitor to the computer. PCs usually use a
VGA (Video Graphics Array) analog connector (also known as a D-Sub
connector) that has 15 pins in three rows. Typically blue in color.
37
What is A Computer?
Ports – Means of connecting peripheral devices to your computer.
◼ Parallel Port – Most often used to connect a printer to the computer. 25-pin
connector. Long and skinny, often pink in color. Transmits data at 50-100
Kb/s.
◼ USB Port – Universal Serial Bus. Now used to connect almost all peripheral
devices to the computer. USB 1.1 transmits data at 1.5 Mb/s at low speed, 12
Mb/s at full speed. USB 2.0 transmits data at 480 Mb/s.
38
What is A Computer?
Ports – Means of connecting peripheral devices to your computer.
◼ PS/2 Port- sometimes called a mouse port, was developed by IBM. It is used
to connect a computer mouse or keyboard. Most computers come with two
PS/2 ports.
◼ Ethernet Port– This port is used for networking and fast internet connections.
Data moves through them at speeds of either 10 megabits or 100 megabits or 1
gigabit (1,000 megabits) depending on what speed the network card in the
computer supports. Little monitor lights on these devices flicker when in use.
39
What is A Computer?
Power Supply – Gives your computer power by converting
alternating current (AC) supplied by the wall connection to direct
current (DC).
40
What is A Computer?
Expansion Cards – Used to add/improve functionality to the
computer.
Sound Card – Used to input and output sound under program
control. Sound cards provide better sound quality than the built in
sound control provided with most computers.
Graphics Card – Used to convert the logical representation of an
image to a signal that can be used as input for a monitor.
Network Card – Used to provide a computer connection over a
network. Transmit data at 10/100/1000 Mb/s.
41
What is A Computer?
CD ROM – A device used to read CD-ROMs. If capable of writing
to the CD-ROM, then they are usually referred to as a ‘burner’ or
CD-RW.
DVD ROM – A device that is used to read DVDs/CDs. If capable of
writing to the DVD, then it is often referred to as a DVD-burner or a
DVD-RW.
Floppy Drive – A device that is used to read/write to floppy
diskettes.
42
What is A Computer?
Fan – Keeps your computer cool. If the inside of your computer
becomes too hot, then the computer can overheat and damage parts.
Heatsink – Used to disperse the heat that is produced inside the
computer by the CPU and other parts by increasing surface area.
43
What is A Computer?
The little parts– Capacitors – store energy, Resistors – allows a
current through, Transistors – a valve which allows currents to be
turned on or off.
Case – (Tower if standing upright.) What your motherboard, CPU,
etc is contained in.
44
Comprehension Questions
1. What are the 3 main components of a computer?
2. Name 3 input devices. Name 3 output devices.
3. What is the brain of the computer?
4. Explain the difference between memory and your hard
drive.
5. What are the similarities and differences between
RAM, ROM, and hard drives?
6. Describe each of the different ports.
8. What gives your computer power?
45
46
Memory
47
Memory Organization and Addressing
◼ You can envision memory as a matrix of bits. Each row,
implemented by a register, has a length typically equivalent
to the word size of the machine. Each register (more
commonly referred to as a memory location) has a unique
address; memory addresses usually start at zero and
progress upward.
◼ In this situation, when a word uses multiple bytes, the byte with
the lowest address determines the address of the entire word.
◼ transistor turns on
❑ Charge from capacitor fed via bit line to
sense amplifier
❑ Compares with reference value to determine 0
or 1
⚫Capacitor charge must be restored
Static RAM Operation
◼ Transistor arrangement gives stable logic state
◼ State 1
❑ C1 high, C2 low
❑ T1 T4 off, T2 T3 on
◼ State 0
❑ C2 high, C1 low
❑ T2 T3 off, T1 T4 on
◼ Address line transistors T5 T6 is switch
◼ Write – apply value to B & compliment to B
◼ Read – value is on line B
Address line transistors T5 T6 is switch
Write – apply value to B & compliment to B
Read – value is on line.
Static RAM
◼ Bits stored as on/off switches
◼ No charges to leak
◼ No refreshing needed when powered
◼ More complex construction
◼ Larger per bit
◼ More expensive
◼ Does not need refresh circuits
◼ Faster
◼ Cache
◼ Digital
❑ Uses flip-flops
SRAM v DRAM
◼ Both volatile
❑ Power needed to preserve data
◼ Dynamic cell
❑ Simpler to build, smaller
❑ More dense
❑ Less expensive
❑ Needs refresh
❑ Larger memory units
◼ Static
❑ Faster
❑ Cache
Comparison between DRAM and SRAM
DRAM SRAM
Flash memory
◼ Programmable and erased using electrical shots.
◼ Erased block by block
◼ Erased so quick (in a flash).
Chip organization
◼ The question is how to put the memory on a chip…… ??
◼ If we have a memory of 2n location with 32-bits each,
so, it can be represented by one of two means:-
1- Put it in the form of a
matrix with 2n rows and
32 columns.
→But this architecture
is not suitable because
the length is much more
than its width.
Memory Words
62
Use a group of blocks each will represent a bit, then we need
32 blocks.
◼Each block contains 2n bits represented as square matrix: 2n/2
rows and 2n/2 columns.
◼The size will be smaller than the first solution.
1 2n/2
Bit 1 1 Bit
32
Bit 1 2n/2
Bit
Total bits in the square = 2n 32
32 blocks
Bit 32
Bit 3
Bit 2
Bit 1
Bit 4
Bit 3
Bit 2
Bit 1
Column Decoder
Column Address
68
69
RAM Chips
◼ A RAM chip is faster when communicating with CPU than dealing
with Auxiliary devices directly.
◼ If the memory needed for the computer is larger than the
capacity of one RAM chip, we combine a number of chips to form
required memory size.
◼ If we have many RAM chips, we must choose to access one of
them
◼ We use control inputs to select the chip only when needed.
0 0 X X Inhibit High-impedance
0 1 X X Inhibit High-impedance
1 0 0 0 Inhibit High-impedance
1 1 X X Inhibit High-impedance
71
ROM Chips
◼ A ROM chip is organized externally in a similar manner. ROM can
only read, the data bus can only be in an output mode.
◼ For the same–size chip, it is possible to have more bits of ROM than
of RAM, because the internal binary cells in ROM occupy less space
than in RAM.
◼ For this reason, the diagram specifies a 512-byte ROM, while the
RAM has only 128 bytes.
◼ address lines = 9 bits (512 = 29)
◼ The two chip select inputs must be CS1=1 and CS2= 0 for the unit
to operate.
◼ Otherwise, the data bus is in a high-impedance state.
72
Practical Example : How CPU deal with RAM and
ROM
Assume that a computer system has:
◼ 512 bytes of RAM (we use 4 blocks of RAM of the same type
128X8)
◼ 512 bytes of ROM (single block).
73
bits 8 - 9
2 X 4 Decoder
Decoder
3 2 1 0 CS1
CS2
RD 128 x 8 Data
WR RAM
AD7
CS1
CS2
RD 128 x 8 Data
WR RAM
AD7
CS1
CS2
RD 128 x 8 Data
WR RAM
AD7
CS1
CS2
RD 128 x 8 Data
WR RAM
AD7
CS1
CS2
512 x 8 Data 75
AD9 ROM
(0000 0000 0000 0000)2 = (0000)16
(0000 0000 0111 1111)2 = (007F)16
(0000 0000 1000 0000)2 = (0080)16
(0000 0000 1111 1111)2 = (00FF)16
(0000 0001 0000 0000)2 = (0100)16
(0000 0001 0111 1111)2 = (017F)16 76
77