Computer Architecture | O Level Computer Science 2210 & IGCSE Computer Science 0478 | Detailed Free Notes To Score An A Star (A*)
Computer Architecture
- Focuses on how a computer actually works.
- Important components
- Central Processing Unit (CPU)
- Also called processor or microprocessor
- A computer cannot work without this part
- Usually a single microchip contains the CPU as an integrated circuit.
- All processing and execution occurs here.
- 3 Main Parts
- Control Unit (CU)
- Arithmetic and Logic Unit (ALU)
- Registers and Buses
- Central Processing Unit (CPU)
- Von Neumann Architecture
- Early computers
- Required data to be fed side by side as it was working
- No stored programs
- Needed a lot of human labor
- Jon von Neumann
- Solves this situation back n 1940s
- Stored program computer
- The basics of all computer systems today
- Main features that were new to the system back in 1940s
- CPU
- Accessing the memory directly by CPU
- Memories can stores data and programs
- Stored programs have instructions that can be executed when the program is run.
- Main Parts of the CPU
- Arithmetic and Logic Unit (ALU)
- Arithmetic operations
- + – and shifting
- Logic operations
- AND and OR
- Runs these operations when the program is being run
- More than one ALU can be present in a computer for specific instructions
- Multiplication and Division are not functions that ALU performs directly
- Instead, it performs it using sequences of additions, subtraction or logical shift operations
- Arithmetic operations
- Control Unit (CU)
- Reads instructions from memory
- The address where the instruction is stored is found in Program Counter (PCC)
- The Fetch-Decode-Execute cycle is used to interpret the instruction
- Signals are generated along the control bus
- It tells other parts in the computer about what to do based on the instructions
- Control Unit
- Synchronizes the data flow and program instructions throughout the computer system
- System Clock
- Produces timing signals on the control bus to ensure synchronization
- A computer can’t work without the system clock
- Backing Store
- CPU takes data and programs that are stored here.
- Backing store is basically a secondary memory
- This memory is permanent and non-volatile.
- Example is hard disk drive
- The data taken from here is paced in the RAM temporarily
- Arithmetic and Logic Unit (ALU)
- RAM
- All data and programs are contained on the RAM that are to be accessed by the CP
- Remember, RAM is not the permanent storage
- It is a volatile/ temporary memory – also the primary memory.
- It is also called Immediate Access Store (IAS)
- Read/ Write operations can be completed faster in RAM compared to backing storage
- Any important data required by an application will be stored in RAM
- Speeds the operations
- Registers
- Extremely important part of the architecture
- Two types
- General
- Specific Purpose
- Current Instruction Register (CIR)
- Stores the current instruction that is being decoded and executed.
- Accumulator (ACC)
- During ALU calculations, data is stored here temporarily
- Memory Address Register (MAR)
- Stores address of the memory location currently being read or written
- Memory Data/ Buffer Register (MDR)
- Stores data that has just been read from memory
- Or data that is about to be written in the memory
- Program Counter (PC)
- Address of the next instruction to be read
- Current Instruction Register (CIR)
- Memory
- Partitions in computer memory
- Each partition has contents and address
- Address uniquely identifies every location in the memory
- Contents stored in the location is binary
- The steps are as follows
- Read operation
- The address of the location of the memory specified is written onto the MAR
- A read signal is sent to computer memory
- Content of the memory location is put into the MDR
- Write operation
- Data to be stored is first written onto the MDR
- Data has to be written to a specified address – this address is written into the MAR
- Write signal is sent to computer memory and the content will be written into the memory address
- Read operation
- Partitions in computer memory
- Input and Output Devices
- Input devices convert external data to computerized form
- Output devices convert computer data to human understandable form.
- System Buses
- Used in computers as parallel transmission components
- Each write transmits one bit of data
- 3 common buses
- Address Bus
- Carrier addresses throughout the computer system
- Unidirectional between CPU and memory
- Bit travel in one direction
- Prevents addresses being carried back to the CPU
- Bus width is extremely important
- Wider bus can address more memory locations at the same time.
- For example, a bus width of 32 can address 2^32 memory locations concurrently (4294967296 memory locations)
- Data Bus
- Data bus is bidirectional
- Data ca be carried to and from CPU to memory/ or to and from input and output devices
- Data can be an address, numerical value or instruction
- Width of the bus is imporant
- A wider bus can transport larger word length
- Word in this case means a group of bits that can be regarded as one single unit. For example 64-bit.
- Larger word length provides better overall performance
- Control Bus
- Bidirectional
- Signals are carried from control unit (CU) to other system components
- Usually 8-bits wide.
- No wider bus needed because only control signals are sent.
- Address Bus
- Fetch-Decode-Execute Cycle
- CPU first fetches some data/ instructions from memory and stores them in suitable registers
- Address bus and data bus are used.
- Each instruction has to be decoded
- Then executed.
- The cycle
- Fetch
- Data and instructions are stored in MDR
- The next instruction is fetched from memory address stored in MAR
- Instruction stored in MDR
- Contents of MDR are copied on Current Instruction Register (CIR)
- PC is incremented by 1 (increased by 1)
- This provides the next instruction address
- Decode
- Interpret the instruction
- Execute
- The decoded instructed is passed by the CPU as a set of control signals to the appropriate components within the computer system
- Each instruction is carried out in logical sequence
- Fetch
- CPU first fetches some data/ instructions from memory and stores them in suitable registers
- Early computers
- Cores, Cache and Internal Clock
- What determines the performance of CPU
- System clock
- Defines the clock cycle
- Synchronizes the computer operations
- Control bus transmits the timing signals for synchronization
- With increased clock speed, computer processing speed also increases.
- For example, when we say a 4.2 GHz processor, it means it has 4.2 billion clock cycles a second.
- However, speed increase does not mean that overall performance has been increased
- Other Factors
- Width of the address and data bus.
- Over clocking
- BIOS (Basic Input/ Output System) can be used to change the clock speed.
- However, a clock speed higher than the computer’s supported design can result in problems
- Unsynchronized operations when instructions are overclocked
- One instruction not properly completed before the next one occurs.
- Frequent crashes and instability
- It can result in overheating of CPU, causing damage and unreliable performance
- Use of Cache memories
- Temporary memory inside the CPU
- Faster access time than RAM
- Frequently performed instructions are contained here.
- First cache checked and then RAM accessed
- Larger cache ensures better performance
- Different number of Cores
- (Quadcore, Octa-core etc.)
- One core has one ALU, CU and registers
- Multiple cores allow more sets of ALU, CU and registers
- Clock speed does not need to be increased continually
- However, increasing cores does not necessarily improve performance
- CPU has to communicate with each core.
- Reduce overall performance
- System clock
- What determines the performance of CPU
Instruction Set
- A set of operations that are decoded in a sequence is called instruction
- Each operation
- Instructions ALU and CU
- Operation
- Made of opcode and operand
- Opcode informs CPU about what operations must be done
- Operand is the data that is acted on or the register in the memory
- Only a limited number of opcodes can be used
- Called instruction set
- All software on the computer will have a set of instructions
- They need to be converted to binary form
- The Fetch-Decode-Execute cycle is the step sequence that CPU uses to process each instruction.
- X86 CPU instruction set
- Common one
- Share identical instruction set if based on it.
Embedded Systems
- Combination of hardware and software that can carry out specific instructions
- Such systems can be electrical, electronic or electro-mechanical
- Can be based on
- Microcontrollers
- A CPU plus some RAM and ROM, along with peripherals all embedded together in a single chip
- Can carry specific tasks together
- Microprocessor
- Integrated circuit which only bas a CPU
- SoC
- System on chips
- A microcontroller present as one of the component
- It has a CPU, memory, input/output (I/O) ports and secondary storage on a single microchip.
- Microcontrollers
- General work methods
- Specific set of tasks
- User interface
- Some form of output
- Very latest embedded systems have powerful CPUs and multiple I/O connections so multiple applications can occur
- Can contain mechanical components, software, actuators and sensor inputs
- Analogue or digital input
- Feedback oriented systems
- Either automatic data input or an operator can enter data.
- Functions are performed on the data
- Signals are sent to the controlled components to perform certain actions
- Embedded system may be programmable or non-programmable.
- Non-programmable devices are replaced to update software
- Programmable devices have two methods of upgrade
- Download the updates by connecting the device to the system.
- Automatic updates via an internet source, for example Wi-Fi or cellular.
- Benefits
- Small size so fit easily
- Lower costs to make
- Dedicated to single task so simple interface
- No operating system required
- Minimal power consumption
- Controlled remotely
- Fast reaction to the input, so even real time work possible
- Reliable due to mass production
- Drawbacks
- Difficult to upgrade
- Specialists required to troubleshoot them
- Confusing interface
- Accessible to the hackers and viruses
- Thrown away instead of repairing due to the difficulties in the repair
- An computer is not an embedded system
- It is multi-functional
- Examples
- Motor vehicles
- Many parts are based on embedded functions
- For example the GPS system or ABS system
- Set-top box
- Uses an embedded system to record and play television programs
- Can be operated remotely
- Has RAM, SSD, keypad interface, sensor input and output
- Lighting systems
- Architectural lighting uses these systems to sense light and adjust artificial lighting accordingly
- Vending systems
- Use micro-controller
- To make selection
- To show position of the gates
- Coin counters
- Temperature sensors
- Actuators
- Display systems
- Wireless modems
- Use micro-controller
- Washing machines
- White goods such as microwaves, refrigerators and washing machines etc. have embedded systems
- Determine things like temperature, cycle time, water quantity, display results, have input system etc.
- Motor vehicles
