Sie sind auf Seite 1von 31

INSIDE THE COMPUTER

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

Some important terminology

Some important terminology


Kilobyte (K)
210 bytes 1024 bytes

Megabyte (M)
20 2 bytes

Over 1 million bytes 1,048,576

Gigabyte (G)
30 2 bytes Over 1 billion

Some important terminology


Terabyte (T)
240 bytes Over 1 trillion

Example: 16 megabyte of memory = 16 x 220 4 20 2 2 = x 24 2 = bytes

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

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

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 CPU e.g. keyboard and video monitor

Internal organization of computers

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 assigned an address Address in a given device must be unique Uses the address bus

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

More about the data bus


Used to carry information in and out of a CPU, the more data buses available, the better 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 buses Example: 8 bits can send 1 byte at a time 16 bits can send 2 bytes at a time

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 x 2 The number of locations is equal to where x is the number of address lines, regardless of the size of the data bus

More about the address bus


Example: A CPU with 16 address lines = 65,536 bytes 16 2 = bytes = 64K bytes Each location can have a maximum of 1 byte of data (byte addressable)

CPU and its relation to RAM and ROM


ROM
Provide information that is fixed and permanent
Tables for character patterns to be displayed on the video monitor Programs that are essential to the working of the computer
Programs for testing and finding the total amount of RAM installed in the system

Programs to display information on the video monitor

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

CPU and its relation to RAM and ROM

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

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

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 to register A is 1011 0000 (B0H) Adding a value to register A 0000 0100 (04H)

Internal working of computers


Example: Equivalent Code:
Action Move value 21H into register A Add value 42H to register A Add value 12H to register A Code B0H 04H 04H Data 21H 42H 12H

Internal working of computers


Example:
If the program to perform the actions is stored in memory locations starting at 1400H
Memory Address 1400 1401 1402 1403 1404 1405 1406 Contents of memory address (B0) the code for moving a value to register A (21) the value to be moved (04) the code for adding a value to register A (42) the value to be added (04) the code for adding a value to register A (12) the value to be added (F4) the code for halt

Internal working of computers


Example: CPU Actions 1. IP = 1400H 2. 1400H -> address bus READ signal is activated B0H -> data bus 3. B0H is decoded using decoder dictionary 1401H -> address bus READ signal is activated 21H -> data bus -> register A

Internal working of computers


4. IP = 1402H READ signal is activated 04H -> data bus 04H is decoded using decoder dictionary 1403H -> address bus READ signal is activated 42H -> data bus ALU performs addition 42H + 21H = 63H 63H -> register A

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

Internal working of computers


6. IP = 1406 READ signal is activated F4H -> data bus F4H is decoded using decoder dictionary IP will stop incrementing

END

BRIEF HISTORY OF THE CPU


(Next Topic)

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.

Exercises
6. 7. 8. What does CPU stand for? Explain its function in a computer. List three types of buses found in computer systems and state briefly the purpose of each type of bus. State which of the following is unidirectional and which is bidirectional.
a) b) Data bus Address bus

9.

If an address bus for a given computer has 16 lines, then what is the maximum amount of memory it can access? 10. What does ALU stand for? What is its purpose?

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?

Das könnte Ihnen auch gefallen