02 inside the computer
TRANSCRIPT
-
8/12/2019 02 Inside the Computer
1/31
INSIDE THE COMPUTER
-
8/12/2019 02 Inside the Computer
2/31
Some important terminology
Amounts of memory
Bit A binary digit that can have the value 0 or 1
Byte Defined as 8 bits
Nibble Half a byte
4 bits
Word Two bytes
16 bits
-
8/12/2019 02 Inside the Computer
3/31
Some important terminology
-
8/12/2019 02 Inside the Computer
4/31
Some important terminology
Kilobyte (K)
bytes
1024 bytes
Megabyte (M) bytes
Over 1 million bytes
1,048,576 Gigabyte (G)
bytes
Over 1 billion
102
202
302
-
8/12/2019 02 Inside the Computer
5/31
Some important terminology
Terabyte (T)
bytes
Over 1 trillion
Example:
16 megabyte of memory
= 16 x
= x
= bytes
402
202
42
202
242
-
8/12/2019 02 Inside the Computer
6/31
Some important terminology
Two types of memory
RAM
Random Access Memory
Read / Write memory
Temporary storage of programs that it is running
Data is lost when the computer is turned off
Volatile memory
-
8/12/2019 02 Inside the Computer
7/31
Some important terminology
Two types of memory
ROM
Read-Only Memory
Contains program and inform essential to
operation of the computer
Information stored is permanent / cannot be
change by the user / not lost when the power is
turned off
Nonvolatile memory
-
8/12/2019 02 Inside the Computer
8/31
Internal organization of computers
Internal parts of the computer
Central Processing Unit (CPU)
Execute (process) information stored in memory
Memory
Information is stored
Input / Output
Provide a means of communicating with the CPUe.g. keyboard and video monitor
-
8/12/2019 02 Inside the Computer
9/31
Internal organization of computers
-
8/12/2019 02 Inside the Computer
10/31
Internal organization of computers
Three types of buses:
Address bus
Data bus
Control bus
Memory Address
For a device (memory or I/O) to be
recognized by the CPU, it must be assignedan address
Address in a given device must be unique
Uses the address bus
-
8/12/2019 02 Inside the Computer
11/31
Internal organization of computers
Control Bus
Used to provide read or write signals to the
device to indicate if the CPU is asking for
information or sending it information
-
8/12/2019 02 Inside the Computer
12/31
More about the data bus
Used to carry information in and out of aCPU, the more data buses available, thebetter but more expensive the CPU
Average size of data buses in CPU 8(Apple 2) and 64 (Cray) / bidirectional
The processing power of a computer is
related to the size of its busesExample:
8 bits can send 1 byte at a time
16 bits can send 2 bytes at a time
-
8/12/2019 02 Inside the Computer
13/31
More about the address bus
Used to identify the devices and memory
connected to the CPU, the more address
buses available, the larger the number of
devices that can be addressed
The number of locations is equal to
where x is the number of address lines,
regardless of the size of the data bus
x
2
-
8/12/2019 02 Inside the Computer
14/31
More about the address bus
Example:
A CPU with 16 address lines
= 65,536 bytes= bytes
= 64K bytes
Each location can have a maximum of 1byte of data (byte addressable)
162
-
8/12/2019 02 Inside the Computer
15/31
CPU and its relation to RAM and
ROM
ROM
Provide information that is fixed and
permanent
Tables for character patterns to be displayed onthe video monitor
Programs that are essential to the working of the
computer
Programs for testing and finding the total amount of RAMinstalled in the system
Programs to display information on the video
monitor
-
8/12/2019 02 Inside the Computer
16/31
CPU and its relation to RAM and
ROM
RAM
Used to store information that is not
permanent and can change with time
Various versions of the operating system
Application packages
Word processing
Tax calculation packages
-
8/12/2019 02 Inside the Computer
17/31
CPU and its relation to RAM and
ROM
-
8/12/2019 02 Inside the Computer
18/31
Inside CPUs
Registers
Used to store information temporarily
Data / Instructions
Memory Address
8-bit, 16-bit, 32-bit, and 64-bit
ALU (arithmetic / logic unit)
Responsible for performing Arithmetic functions such as add, subtract,
multiply, and divide
Logic functions such as AND, OR, and NOT
-
8/12/2019 02 Inside the Computer
19/31
Inside CPUs
Program Counter
It point to the address of the next instruction to be
executed. As each instruction is executed, the
program counter is incremented to point to the
address of the next instruction to be executed
IBM (Instruction Pointer)
Instruction Decoder
It interpret the instruction fetched into the CPU Like the dictionary, it stores the meaning of each
instruction and what steps the CPU should take upon
receiving a given instruction
-
8/12/2019 02 Inside the Computer
20/31
Internal working of computers
Example:
Imaginary CPU has registers A, B, C, and D
Has 8-bit data bus and 16-bit address bus
CPU can access memory from 0000 to FFFF
Assume the CPU will put 21H into register A,
and then add to register A values 42H and 12H
Assume that the code for moving a value toregister A is 1011 0000 (B0H)
Adding a value to register A 0000 0100 (04H)
-
8/12/2019 02 Inside the Computer
21/31
Internal working of computers
Example:
Equivalent Code:
Action Code Data
Move value 21H into register A B0H 21H
Add value 42H to register A 04H 42H
Add value 12H to register A 04H 12H
-
8/12/2019 02 Inside the Computer
22/31
Internal working of computers
Example:
If the program to perform the actions is stored in
memory locations starting at 1400H
Memory Address Contents of memory address
1400 (B0) the code for moving a value to register A
1401 (21) the value to be moved
1402 (04) the code for adding a value to register A
1403 (42) the value to be added
1404 (04) the code for adding a value to register A
1405 (12) the value to be added
1406 (F4) the code for halt
-
8/12/2019 02 Inside the Computer
23/31
Internal working of computers
Example:
CPU Actions
1. IP = 1400H
2. 1400H -> address busREAD signal is activated
B0H -> data bus
3. B0H is decoded using decoder dictionary
1401H -> address busREAD signal is activated
21H -> data bus -> register A
-
8/12/2019 02 Inside the Computer
24/31
Internal working of computers
4. IP = 1402H
READ signal is activated
04H -> data bus
04H is decoded using decoder dictionary1403H -> address bus
READ signal is activated
42H -> data bus
ALU performs addition 42H + 21H = 63H
63H -> register A
-
8/12/2019 02 Inside the Computer
25/31
Internal working of computers
5. IP = 1404H
READ signal is activated
04H -> data bus
04H is decoded using decoder dictionary
1405H -> address bus
READ signal is activated
12H -> data bus
ALU performs addition 63H + 12H = 75H
63H -> register A
-
8/12/2019 02 Inside the Computer
26/31
Internal working of computers
6. IP = 1406
READ signal is activated
F4H -> data busF4H is decoded using decoder dictionary
IP will stop incrementing
-
8/12/2019 02 Inside the Computer
27/31
END
-
8/12/2019 02 Inside the Computer
28/31
BRIEF HISTORY OF THE
CPU(Next Topic)
-
8/12/2019 02 Inside the Computer
29/31
Exercises
1. How many bytes is 24 kilobytes?
2. What does RAM stand for? How is it
used in computer system?
3. What does ROM stand for? How is it
used in computer system?
4. Why is RAM called volatile memory?
5. List the three major components of a
computer system.
-
8/12/2019 02 Inside the Computer
30/31
Exercises
6. What does CPU stand for? Explain its function in acomputer.
7. List three types of buses found in computer systemsand state briefly the purpose of each type of bus.
8. State which of the following is unidirectional and whichis bidirectional.
a) Data bus
b) Address bus
9. If an address bus for a given computer has 16 lines,then what is the maximum amount of memory it canaccess?
10. What does ALU stand for? What is its purpose?
-
8/12/2019 02 Inside the Computer
31/31
Exercises
11.How are registers used in computer
systems?
12.What is the purpose of the program
counter?
13.What is the purpose of the instruction
decoder?