Computer Organisation and Architecture Flashcards
The processor
The computer processor executes program instructions to run applications
Main memory
The main memory is used to store program instructions and and frequently used data
It is much faster than secondary storage so storing frequently used data in RAM or ROM helps the
processor to execute instructions quickly
RAM and ROM
RAM is Random Access Memory - it is volatile and can be accessed directly with the same access time for all read/write operations
- Its used as a store for currently running programs
ROM is Read Only Memory - it is non-volatile, meaning its contents aren’t lost when the power supply is turned off
- Its used to store programs and data that are needed as soon as the computer is turned on
Buses
Buses are parallel wires that transfer signals between the internal components of the processor
Address bus
The address bus is a one way bus used to transfer memory addresses and I/O locations
It goes out of the processor to other components
Wider address bus = more memory can be accessed as once
Each additional wire doubles the number of possible addresses that can be accessed
Data bus
The data bus is a two way bus that transfers between the various components
It is one way out of the input controllers to other components and is one way into output controllers from other components
Wider data bus = more data can be transferred at once
Control bus
The control bus is a two way bus that transports control signals such as memory read/write, interrupts and timing signals
The stored program concept
The stored program concept states that:
- A computer program must be resident in the main memory to be executed
- Machine code instructions are fetched from the main memory, decoded and executed by the processor one by one in sequence
- The program in main memory may be replaced with another program at any time
The processor is instructed to perform arithmetic and logical operations - these are represented by machine code instruction
Processor components
- Arithmetic logic unit = Performs arithmetic and logical operations on data
- Control unit=
Controls the various components of the
processor, as well as the fetch-decode-execute cycle - The clock = Supplies a timing signal at a fixed rate. These signals are used to regulate the rate at which instructions are executed and to sync the operation of computer components
Registers
Registers are very fast memory locations inside the processor or I/O controller
General purpose registers don’t have a specific role and can be used as storage for any data that is
required by instructions during execution
Dedicated registers do have a specific role
Dedicated registers
- Program Counter = Holds the memory address of the next instruction to be fetched from main memory
- Memory Address Register = Holds the address of the memory location currently being accessed by the processor
- Memory Buffer Register = Holds the data item being transferred to and from the memory location being accessed by the processor
- Current Instruction Register = Stores a copy of the current instruction, both operand and op-code while it is being decoded and executed
- Status Register = Holds condition codes to indicate the outcome of operations
Fetch-Decode-Execute cycle: Fetch
1) The content of the PC is copied to the MAR
2) The content of the MAR is transferred to main memory by the address bus
3) The instruction is sent from main memory to the MBR by the data bus
4) The PC is incremented by one
5) The content of the MBR is copied to the CIR
Fetch-Decode-Execute cycle: Decode
1) The content of the CIR is decoded by the control unit
2) The decoded instruction is split into two parts: opcode
and operands
Fetch-Decode-Execute cycle: Execute
1) Any data required by the instruction that isn’t present in registers is fetched
2) The instruction is carried out
3) Results of any calculations are stored in general purpose registers or main memory
Interrupts
An interrupt is a signal from some device that is seeking the attention of the processor
They can be caused by program errors (arithmetic overflow) and I/O controllers (data transfer completion)
When an interrupt occurs, it is detected as a change in the content of the status register
between the execute and fetch stages of the fetch-execute cycle
Dealing with interrupts
If an interrupt has been detected:
1) The contents of the program counter are saved in a stack
2) The contents of all the other registers used by the current program are also saved in a stack
3) The source of the interrupt is determined
4) Lower priority interrupts are disabled to stop them interrupting the interrupt
5) The program counter is loaded with the start address of the relevant interrupt service routine
6) The interrupt service routine is executed
7) Once the ISR is complete, the saved register values (other than the PC) belonging to the interrupted program are copied back into the relevant registers
8) Interrupts are re-enabled
9) The saved value of the PC is restored to point to the next instruction of the interrupted program to be fetched and executed
Processor instruction set
The processor instruction set is the set of bit patterns / binary codes for the machine operations that a processor has been designed to perform
A machine code instruction is divided into the opcode and the operand - the opcode is the instruction to be executed while the operand respresents a data item or the address of a data item
Addressing modes
The opcode can be subdivided into a part that represents how the operand should be interpreted called the addressing mode
- Immediate addressing = Where the operand is the actual value to use
The # symbol is usually used to show that immediate addressing is being used
(ex: MOV R2, #20) - Direct addressing = The operand is the memory address of the location containing the data or where the data is stored
Factors affecting processor performance
- Number of cores = The more cores a processor has, the more instructions can be executed at the same time, since each core can run independently. Tasks can be split up between cores
- Cache memory = The more cache a processor has, the more information it can store and the more time it can save in fetching information from main memory.
- Clock speed = A processor’s clock speed relates to the frequency of the pulses generated by the system clock. The higher the frequency, the more cycles of the fetch-execute cycle can be completed in the same period of time.
- Word length = A word is a group of bits that is treated as a single unit by a processor.
Words can be used
for representing both instructions and data. The length of a word is the number of bits that are assigned to it, with higher word lengths allowing for more bits to be transferred and manipulated as a single unit
Factors affecting processor performance - Buses
- Address bus width = The wider the address bus of a processor, the more memory locations the processor can address simultaneously
- Data bus width = Increasing the width of the data bus increases the volume of data that can be transferred
over the bus at any one time.
A wider data bus allows the processor to fetch more data from main memory in one cycle of the fetch-execute cycle, reducing the number of cycles required to fetch large volumes of data
Barcodes
A barcode is a diagram that consists of black and white lines that contain information, usually about a product
1D barcodes are straight black and white lines while 2D barcodes are called QR codes and store more information but needs more processing to extract the information
Barcode readers
A barcode reader uses a laser and a light sensor to read barcodes
The barcode laser is directed to the barcode - the light reflected by the barcode reenters the barcode reader and is processed to create an electrical signal that represents the contents of the barcode
White bars reflect the most light while black light reflects the least light - this creates a pattern of reflection that is processed
Digital camera
Digital cameras consist of a lens and light sensors
When a photo is taken, the shitter opens and lets light enter the camera.
The light hits the sensors at the back of the camera - each sensor converts the light into an electric charge that builds up on the cells of the sensor; each cell represents a pixel in the image.
Once the photo has been taken, the charge in each cell is measured and converted to a digital value which is processed by the camera and stored as a digital image
Two types of camera sensors, CMOS and CCD sensors
CMOS sensors take high quality images but use a lot of power
CCD sensors take lower quality images but use less power
Laser printer
A laser printer uses powdered ink and a magnetically charged drum to produce high quality printing at high speeds
Printer software produces a bitmap image of what needs to be printed - the drum is then positively charged.
A laser is bounced off a mirror and shone onto the drum - this creates an impression of the image in electrical charge on the drum
This laser causes the areas it touched to lose their charge
The negatively charged toner particles are attracted to the positively charged parts of the drum - the toner is then applied to paper by the drum and fusers that use heat and pressure to fix the toner onto the paper