CH 2
CH 2
Architecture
Basic Microcomputer Design
The central processor unit (CPU), where calculations and logic operations
take place, contains a limited number of storage locations named registers , a
high-frequency clock, a control unit, and an arithmetic logic unit.
The clock synchronizes the internal operations of the CPU with other system
components.
Each operation involving the CPU and the system bus is synchronized by an
internal clock pulsing at a constant rate.
The basic unit of time for machine instructions is a machine cycle (or clock
cycle).
Fetch: The control unit fetches the next instruction from the instruction
queue and increments the instruction pointer (IP). The IP is also known as the
program counter
Decode: The control unit decodes the instruction’s function to determine
what the instruction will do. The instruction’s input operands are passed to
the ALU, and signals are sent to the ALU indicating the operation to be
performed.
Fetch operands: If the instruction uses an input operand located in memory,
the control unit uses a read operation to retrieve the operand and copy it into
internal registers. Internal registers are not visible to user programs.
Instruction Execution Cycle
Execute: The ALU executes the instruction using the named registers and
internal registers as operands and sends the output to named registers and/or
memory. The ALU updates status flags providing information about the
processor state.
Store output operand: If the output operand is in memory, the control unit
uses a write operation to store the data.
Instruction Execution Cycle
loop
fetch next instruction
advance the instruction pointer (IP)
decode the instruction
if memory operand needed, read value from memory
execute the instruction
If result is memory operand, write result to memory
continue loop
Reading from Memory
The operating system (OS) searches for the program’s filename in the current
disk directory.
The OS retrieves basic information about the program’s file from the disk
directory, including the file size and its physical location on the disk drive.
The OS determines the next available location in memory and loads the
program file into memory. Enters information about the program’s size and
location into a table (sometimes called a descriptor table )
How Programs Run