![Page 1: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/1.jpg)
CHAPTER 5 – Computing Components
CS 10051
Professor: Johnnie Baker
Computer Science Department
Kent State University
![Page 2: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/2.jpg)
2
Supplementary Slides for Class
These slides were developed for the material in our Chapter 5 using an alternate textbook. The primary slides for Chapter 5 cover material not covered in these slides.The animation slides included here work better than these same slides work in the primary slides for Ch. 5In order to see the animation, you must choose “slide show” format under “View”.Studying all of these slides should aid you in understanding Chapter 5.A reasonable number of these slides have been added to our primary slides in Chapter 5.
![Page 3: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/3.jpg)
3
The von Neumann Architecture of a Computer
Processor or
Note: The processor is also
called the Central
Processing Unit or the CPU
![Page 4: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/4.jpg)
4
Flow of Information
The parts are connected to one another by a collection of wires called a bus
Figure 5.2 Data flow through a von Neumann architecture
Processor
![Page 5: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/5.jpg)
5
Von Neumann ArchitectureThere are 3 major units in a computer tied together by
buses:
1) Memory The unit that stores and retrieves instructions and data.
2) Processor: The unit that houses two separate components:
The control unit: Repeats the following 3 tasks Fetches an instruction from memoryDecodes the instructionExecutes the instruction
The arithmetic/logic unit (ALU): Performs mathematical and logical operations.
3) Input/Output (I/O) Units: Handle communication with the outside world.
![Page 6: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/6.jpg)
6
Von Neumann Architecture
The architecture is named after the mathematician, John von Neumann, who supposedly proposed storing instructions in the memory of a computer and using a control unit to handle the fetch-decode-execute cycle:
fetch an instruction
decode the instruction
execute the instruction
Although we think of data being stored in a computer, in reality, both data and instructions are stored there.
In one of our programming chapters, we’ll see the format of a typical instruction. Right now, think of it as a sequence of 0s and 1s.
![Page 7: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/7.jpg)
7
Babbage
Interestingly, a similar architecture was proposed in 1830 by Charles Babbage for his Analytic Engine:
ALU millmemory storecontrol unit operator (process
cards storing instructions)
I/O units output (typewriter)
![Page 8: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/8.jpg)
8
More Detail on Computer Architecture
![Page 9: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/9.jpg)
9
MemoryMemory is a collection of cells,
each with a unique physical addressThe size of a cell is normally a power of 2, typically a byte today.
![Page 10: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/10.jpg)
10
MemoryA cell is the smallest addressable unit of memory – i.e. one cell can be read from memory or one cell can be written into memory, but nothing smaller.
![Page 11: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/11.jpg)
11
RAM and ROM
RAM stands for Random Access Memory Inherent in the idea of being able to access each
location is the ability to change the contents of each location
ROM stands for Read Only Memory The contents in locations in ROM cannot be
changed
RAM is volatile, ROM is not This means that RAM does not retain its bit
configuration when the power is turned off, but ROM does
![Page 12: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/12.jpg)
12
MEMORY UNIT (or RAM- Random Access Memory)
Each cell has an address, starting at 0 and increasing by 1 for each cell.
A cell with a low address is just as accessible as one with a high address- hence the name RAM.
The width of the cell determines how many bits can be read or written in one machine operation.
MAR is Memory Address Register
MDR is Memory Data Register
![Page 13: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/13.jpg)
13
What is a Register?
Data can be moved into and out of registers faster than from memory.If we could replace all of memory with registers, we could produce a very, very fast computer ...But, the price would be terribly prohibitive. Most computers have quite a few registers that serve different purposes.We’ll see how the MAR and the MDR are used.
![Page 14: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/14.jpg)
14
How does the memory unit work?
Trace the following operation:
Store data D in memory location 0. DD00 D0 D
s
D
![Page 15: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/15.jpg)
15
How does the memory unit work?
Trace the following operation:
1) Fetch data D from memory location 1.
2) Obtain an instruction I from memory
location 7.
How does the computer distinguish
between 1) and 2) above?
We need to look at the control unit later.
1
D
f
D
I
![Page 16: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/16.jpg)
16
USING THE DECODER CIRCUIT TO SELECT MEMORY LOCATIONS
01234567•••15
4 x 24 decoder 1
0 1 1 1
MAR
0
0
0
0
![Page 17: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/17.jpg)
17
The decoder circuit doesn't scale well--- i.e. as the number of bits in the MAR increases, the number of output lines for the decoder goes up exponentially.
Most computers today have an MAR of 32 bits. Thus, if the memory was laid out as we showed it, we would need a 32 x 232 decoder!
Note 232 is 22 230 = 4 G
So most memory is not 1 dimensional, but 2-dimensional (or even 3-dimensional if banked memory is used).
![Page 18: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/18.jpg)
18
2-D MEMORY
0 1 1 1
MAR
2 x 4 decoder
2 x 4 decoder
columns
rows
Note that a 4 x 16 decoder was used for the 1-D memory.
![Page 19: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/19.jpg)
19
Arithmetic/Logic Unit (ALU)Performs basic arithmetic operations such as addingPerforms logical operations such as AND, OR, and NOTMost modern ALUs have a small amount of registers where the work takes place.For example, adding A and B, we might find A stored in one register, B in another, and their sum stored in, say, A, after the adder computes the sum.
![Page 20: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/20.jpg)
20
The ALU Uses a Multiplexer
R
AL1
AL2ALU
circuits
multiplexer
selector lines
output
GT EQ LT
condition code register
Register R
Other registers
![Page 21: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/21.jpg)
21
ADD X
X
D
D
ADD X
f
ALU1 & ALU2
E
E+DE
D
E+D
E+D
![Page 22: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/22.jpg)
22
Control Unit
A Control Unit is the unit that handles the central work of the computer.There are two registers in the control unit The instruction register (IR) contains the
instruction that is being executed The program counter (PC) contains the
address of the next instruction to be executed
The ALU and the control unit together are called the Central Processing Unit, or CPU
![Page 23: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/23.jpg)
23
ALL A COMPUTER DOES IS ...
Repeat forever (or until you pull the plug or the system crashes)1) FETCH (the instruction)2) DECODE (the instruction)3) EXECUTE (the instruction)
![Page 24: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/24.jpg)
24
The Fetch-Execute Cycle
Fetch the next instructionDecode the instructionExecution Cycle Gets data if needed Execute the instruction
Normally “Get data if needed” is considered part of the “Execute the instruction”.
![Page 25: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/25.jpg)
25
Figure 5.3 The Fetch-Execute Cycle
(3)
(a)
(b)
![Page 26: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/26.jpg)
26
How Does the Control Unit Work?
The PC holds the address of the next instruction to be executed.
Whatever is stored at that address is assumed to be an instruction.
Once the instruction is fetched, the PC is incremented.
![Page 27: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/27.jpg)
27
Input/Output Units
An input unit is a device through which data and programs from the outside world are entered into the computer Keyboard, the mouse, and scanning
devices
An output unit is a device through which results stored in the computer memory are made available to the outside world Printers and video display terminals
![Page 28: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/28.jpg)
28
THE I/O DEVICESPictorially, these look the simplest, but in reality, they form the most diverse part of a computer.
Includes:
keyboards, monitors, joysticks, mice, tablets, lightpens, spaceballs, ....
![Page 29: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/29.jpg)
29
I/O UNITS
Processor MemoryI/O buffer
Control-logic
I/0 device
Each device is different, but most are interrupt driven.
This means when the I/O device wants attention, it sends a signal (the interrupt) to the CPU.
![Page 30: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/30.jpg)
30
IN X
X
DIN X
s
D
D
![Page 31: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/31.jpg)
31
OUT X
X
D
D
OUT X
f
D
![Page 32: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/32.jpg)
32
Problem: Trace Following Actions inside Computer
Increment XCompare XJump XJumpLT X
![Page 33: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/33.jpg)
33
Secondary Storage Devices
Because most of main memory is volatile and limited, it is essential that there be other types of storage devices where programs and data can be stored when they are no longer being processed Secondary storage devices can be installed within the computer box at the factory or added later as needed
![Page 34: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/34.jpg)
34
Magnetic Tape
The first truly mass auxiliary storage device was the magnetic tape drive
A magnetic tape
![Page 35: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/35.jpg)
35
Magnetic Disks
A read/write head travels across a spinning magnetic disk, retrieving or recording data
Figure 5.8 The organization of a magnetic disk
![Page 36: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/36.jpg)
36
Compact Disks
A CD drive uses a laser to read information stored optically on a plastic diskCD-ROM is Read-Only MemoryDVD stands for Digital Versatile Disk
![Page 37: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/37.jpg)
37
Are All Architectures the von Neumann Architecture?
No.One of the bottlenecks in the von Neuman Architecture is the fetch-decode-execute cycle.With only one processor, that cycle is difficult to speed up.I/O has been done in parallel for many years. Why have a CPU wait for the transfer of data between the memory and the I/O devices?Most computers today also multitask – they make it appear that multiple tasks are being performed in parallel (when in reality they aren’t as we’ll see when we look at operating systems).But, some computers do allow multiple processors.
![Page 38: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/38.jpg)
38
Synchronous processingOne approach to parallelism is to have multiple processors apply the same program to multiple data sets
Figure 5.6 Processors in a synchronous computing environment
![Page 39: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/39.jpg)
39
Pipelining
Arranges processors in tandem, where each processor contributes one part to an overall computation
Figure 5.7 Processors in a pipeline
![Page 40: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/40.jpg)
40
Shared-Memory
Shared Memory
Processor Processor Processor Processor
LocalMemory1
Local Memory2
Local Memory3
Local Memory4
Different processors do different things to different data.
A shared-memory area is used for communication.
![Page 41: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/41.jpg)
41
Comparing Various Types of Architecture Typically, synchronous computers have fairly simple processors so there can be many of them – in the thousands.Pipelined computers are often used for high speed arithmetic calculations as these pipeline easily.Shared-memory computers basically configure independent computers to work on one task. Typically, there are something like 8, 16, or at most 64 such computers configured together.
![Page 42: CHAPTER 5 – Computing Components CS 10051 Professor: Johnnie Baker Computer Science Department Kent State University](https://reader033.vdocuments.mx/reader033/viewer/2022051014/5513d25d55034679748b4d6a/html5/thumbnails/42.jpg)
42
Comparing Various Types of Architecture – a simple example
Solve the following problem: Given n integers, see if the integer k is in
the collection
Do this with a von Neumann machine. Do this with a synchronous machine. Do this with a pipelined machine. Do this with a shared-memory machine.