Unit 5 - Computer Organisation and Architecture Flashcards
What is a computer system?
A computer system is any device that can take a set of inputs and process them into useful outputs
What components does the computer base unit contain?
Processor
Main memory
Address, control and data buses
Input/Output (I/O) controllers
What are the I/O controllers?
External devices such as printers, scanners, microphones etc. are produced by different manufacturers
They cannot be directly connected to the processor
An I/O controller for each peripheral device acts as an interface between the device and the computer
What are device drivers?
The software that interacts directly with the I/O controller is called a device driver
When you install a new device (e.g. a new printer) you must install the device driver for it
What are the tasks of an I/O controller?
The controller converts the signals received from a peripheral device into a format the computer can process, and vice versa
It receives I/O requests from the CPU, and then sends device-specific control signals to the device it is controlling
It also manages the data flow to and from the device, freeing the CPU to get on with other tasks
What is the job of the control bus?
The control bus is used to send control signals between each I/O controller and the processor, as well as between the processor and memory
What is the job of the address bus?
The address bus sends memory addresses from the processor to CPU components
What is the job of the data bus?
The data bus sends data between CPU components
What are some control signals?
Memory read
Memory write
Bus request
Bus grant
Clock
What is memory read?
Memory read: causes data from the addressed location to be placed on the data bus
What is memory write?
Memory write: causes data on the data bus to be written into the addressed location
What is bus request?
Bus request: indicates that a device is requesting use of the data bus
What is bus grant?
Bus grant: indicates that the CPU has granted access to the data bus
What is the clock?
Clock: used to synchronise operations
What is a bus?
Buses in a computer consist of a series of wires that transfer data signals between internal components
They typically consist of 8, 16, 32 or 64 lines
What are words?
Memory is divided up in equal units called words
Word length is usually 8, 16, 32 or 64 bits
Each word has a separate memory address
How does the width of the data bus affect system performance?
The width of the data bus is defined by the number of wires or lines it contains
If the data bus is the same width as a computer word, data can be transferred to and from memory in a single operation
If it is 16 lines and a word is 32 bits, it will require two memory access and data transfer operations
Bus width affects overall system performance
Is the data bus bi-directional or only one direction?
The data bus is bi-directional as data can be sent both ways along the bus
Is the address bus bi-directional or only one direction?
This bus carries the address of a memory location in one direction from the processor to I/O controllers and memory
What does the width of the address bus determine?
The width of the address bus determines the maximum possible memory addresses of the system
A 32-bit bus can carry 2^32 (4GiB) addresses
What does main memory store?
Main memory stores data and instructions that are to be processed
What is the smallest addressable unit called?
A word
What is a general purpose computer?
A general purpose computer can perform many different tasks at different times
Their programming is not fixed
What is the stored program concept?
This concept involves storing program instructions in the computer’s memory alongside the data.
Machine code instructions are loaded into main memory to be executed by the processor
The instructions are fetched one at a time and executed immediately by the processor in a sequential order
What is a common implementation of the stored program concept?
The most common implementation of this concept is the von Neumann architecture.
What is the Harvard architecture?
An alternative model separates the data and instructions into separate memories using different buses
Program instructions and data are no longer competing for the same bus
A Harvard architecture means that different sized memory spaces and word lengths can be used for data and instructions.
What is the von Neumann architecture?
Instructions and data are stored in a common main memory and transferred using a single shared bus
Is the Harvard architecture more commonly used with embedded systems or general purpose machines?
Most commonly used with embedded systems performing specialist functions rather than general purpose machines
Is the von Neumann architecture more commonly used with embedded systems or general purpose machines?
Owing primarily to cost and programming complexity, almost all general purpose computers are based on von Neumann’s principles
What are the different components within the CPU?
Arithmetic-Logic Unit (ALU)
Control Unit
Clock
General purpose registers
Dedicated registers
What is the arithmetic logic unit (ALU)?
The problem solving part of the processor
This component performs arithmetic, logical and shift operations on data
Arithmetic operations: Add, Subtract, Multiply and Divide
Logical operations include: AND, OR, NOT, XOR
Shift operations: Move bits to the left or right within a register
What is the control unit?
The part of the processor that coordinates the activity of all other components
Each instruction is accepted and decoded
Separate steps such as fetching the address of data, and fetching the data itself from memory, are identified
Each step is synchronised with a regular pulse from the system clock
What is the system clock?
A series of regular ON/OFF signals are used to synchronise the operations of the processor components
Actions are usually carried out on the rising edge of the clock
Actions each take a fixed number of cycles to complete
What are the general purpose registers?
Results from the ALU need to be stored somewhere
Rather than writing working data back to ‘slow’ memory, processors have several locations of super-fast memory called registers that are used to temporarily store results
The processor is then able to immediately access and re-use these results in subsequent calculations, e.g. Add 2 + 3 + 4
Some processors have a single general purpose register called an Accumulator
What are the different dedicated registers that the processor uses?
Program counter (PC)
Current instruction register (CIR)
Memory address register (MAR)
Memory buffer register (MBR)
Status register (SR)
What is the program counter?
Holds the memory address of the next instruction to be executed
What is the current instruction register?
Holds the current instruction
What is the memory address register?
Holds the address in memory where the processor is required to fetch or store data from or to
What is the memory buffer register?
Temporarily holds data moving between the processor and main memory
What is the status register?
Holds information about the current state of operations. It is used to set flags (e.g. carry or overflow) or to detect error conditions
What happens during the fetch phase in the fetch-decode-execute cycle?
- The address of the next instruction is transferred from PC to MAR.
- The PC is incremented by one.
- Instruction stored in location addressed by MAR is transferred to MBR.
- Instruction transferred from MBR to CIR.
What happens during the decode phase in the fetch-decode-execute cycle?
- Instruction in CIR is decoded.
- Additional data, if required by the instruction, is fetched from the memory.
- and then passed to the registers.
What happens during the execute phase in the fetch-decode-execute cycle?
- Instruction is executed by the ALU.
- Registers are used to store intermediate data or results.
- The result is stored in the accumulator or general purpose register or memory.
What is cache memory?
Cache is a small amount of superfast memory that stores data that is frequently used by the processor
Larger and slower than a register, faster and smaller than RAM
Larger amounts of cache memory can improve processing speed
What factors influence the performance of a processor?
Clock speed - The faster the clock speed, the faster a computer can fetch, decode and execute instructions.
Number of cores: more processors can be linked together on a single chip allowing more instructions to be executed simultaneously
Word length: the amount of data that the CPU can process simultaneously
Address and data bus width
What is an instruction set?
An instruction set describes the commands a processor can perform
Different types of processors have their own instruction sets but they may perform similar or identical operations
What are the types of instruction?
Data transfer such as LOAD, STORE
Arithmetic operations such as ADD, SUBTRACT
Comparison operations to compare two values
Logical operations such as AND, OR, NOT
Branch – conditional and unconditional
Shift operations – shift bits left or right in a register
What is machine code?
Instructions are combinations of binary 1s and 0s; the number of bits used depends on the word length of the processor
This is known as machine code and is the only language the processor can understand
What are the instruction components?
Opcode and Operand
What is Opcode?
Operation code (opcode) which includes
– the actual command the processor needs to carry out, eg. ADD, SUB, etc.
the addressing mode – specifies whether the operand is the actual data, the memory address where the data is held, or a register
What is operand?
Operand(s) – one or more items of data (which can be values, memory addresses or registers) that are to be used in the instruction
What does the operand in an instruction contain, and how is the data described in terms of addressing modes?
The operand in an instruction contains a reference to the data that is to be used. This data may be:
An actual value that can be used directly.
The address in memory where the data is stored.
The register where the data is held.
The addressing mode, typically represented by two bits, specifies which of these options describes the data.
What is immediate addressing?
The operand is the actual value to be used in the instruction
The addressing mode 00 specifies that the data is a value (12 in this case), not an address
This is called immediate addressing
What is direct addressing?
The operand in this case is the address of the location in memory of the data to be used:
The addressing mode has changed:
The addressing mode 01 specifies that the data is an address, not a value
This is called direct addressing
What are some examples of low level languages?
Machine code uses pure binary instructions
Assembly language uses mnemonics for instructions, for example LDA, ADD and MOV
Both of these are low level languages
Assembly language is much easier for programmers to code, but still much harder than a high-level language such as Python or Delphi!
What is the accumulator?
An accumulator is a type of register included in a CPU (Central Processing Unit). It acts as a temporary storage location which holds an intermediate value in mathematical and logical calculations.
What are registers?
Other computers may have up to 16 general purpose registers used to hold values temporarily and perform calculations
How do you load data in assembly code?
LDR Rd, <memory></memory>
Load the value stored in <memory> into register d</memory>
How do you store data in assembly code?
STR Rd, <memory></memory>
Store the value in register d into the memory location specified by <memory></memory>
How do you add data in assembly code?
ADD Rd, Rn, <operand></operand>
Add the value specified in <operand> to the value in register n and store the result in register d</operand>
How do you subtract data in assembly code?
SUB Rd, Rn, <operand></operand>
Subtract the value specified by <operand> from the value in register n and store the result in register d</operand>
How do you move data in assembly code?
MOV Rd, <operand></operand>
Copy the value specified by <operand> into register d</operand>
How does immediate addressing work in assembly language?
The instruction
SUB R3, R2, #5
uses immediate addressing, i.e. it uses the actual value 5 as the operand
How does direct addressing work in assembly language?
The instruction
LDR R1, 300
uses direct addressing, i.e. it uses the memory address (300) holding the value as the operand
How do you compare values in assembly code?
CMP Rn, <operand></operand>
Compare the value stored in register n with the value specified by <operand2></operand2>
How do you branch to instructions in assembly code?
B <label></label>
Always branch to the instruction at position <label> in the program</label>
What are the different conditional branches in assembly code and how do you use them?
B<condition> <label>
e.g. BEQ, BNE, BGT, BLT</label></condition>
Conditionally branch to <label> if the last comparison met the conditions specified by <condition>:</condition></label>
EQ: Equal to 0 NE: Not equal to
GT: greater than LT: Less than
How are logical operators used in assembly code?
AND Rd, Rn, <operand2>
Perform a bitwise logical AND operation between the value in register n and the value specified by <operand2> and store the result in register d.</operand2></operand2>
ORR Rd, Rn, <operand2>
Perform a bitwise logical OR operation between the value in register n and the value specified by <operand2> and store the result in register d.</operand2></operand2>
EOR Rd, Rn, <operand2>
Perform a bitwise logical exclusive or (XOR) operation between the value in register n and the value specified by <operand2> and store the result in register d.</operand2></operand2>
MVN Rd, <operand2>
Perform a bitwise logical NOT operation on the value specified by <operand2> and store the result in register d.</operand2></operand2>
How can the AND operation be used in assembly code?
The AND function can be used to mask out certain bits of a number
This could be used to change an ASCII number to a pure binary number by masking the first four bits
(#00001111B represents the Binary value)
How can the OR function be used in assembly language?
The OR function can be used to set certain bits to 1 without affecting other bits
This could be used, for example, to turn on specific lights in a set of 8 lights
How can the NOT function be used in assembly language?
The NOT function can be used to find the two’s complement of a number.
How is a logical shift performed in assembly code?
LSL (for left) Rd, Rn, <operand>
LSR (for right) Rd, Rn,<operand></operand></operand>
Logically shift the value stored in register n by the number of bits specified by <operand> and store the result in register d</operand>
How do barcode readers work?
Barcode readers typically work on the principle of reflected light
Light from a laser is directed at a pattern and a sensor detects the intensity of light that bounces back
A black bar will absorb more light and be less reflective giving a binary reading of 1
A white bar will be more reflective with a binary reading of 0
The pattern of 0s and 1s creates a unique identity
What are the two common types of barcode systems?
Universal Product Code version ‘A’(UPC-A) / European Article Number(EAN)
Used in retail and warehousing
Code 128
Used in transport and shipment tracking
How do UPC-A / EAN systems barcodes work?
This uses long guard bars to show the start and end of the barcode and also central guard bars to distinguish left uniquely from right
UPC-A / EAN uses seven bar elements to form four alternating dark and light bars of varying thicknesses to represent each data item between the guard bars
What are QR codes?
QR codes are 2D barcodes and can be read by smartphones or tablets
They can contain:
Links to websites or
Information
What are some uses of barcodes?
Airline baggage tracking
Product labelling
Parcel delivery and shipment
Ticketing and identification
What are uses of QR codes?
Restaurant coupons
Mobile concert tickets
Estate agency boards
Business cards
Tourist information
Advertising posters
How do digital cameras work?
A camera works in much the same way as a scanner
When a digital camera captures an image it breaks up what it sees through its lens into a grid of pixels
The shutter opens to let light onto a Charge-Coupled Device (CCD) or Complementary Metal Oxide Semiconductor (CMOS) sensor at the back of the lens
The intensity of light is measured by millions of tiny sensors (one per pixel) arranged in a grid on the sensor
Light levels for each pixel are represented as binary values
This information is now stored as an image in the camera’s memory
How are colours sensed?
Red, Green or Blue filters are used with different sensors in the camera to separate out these wavelengths
The intensity of each of these colours falling on the sensors is measured and stored to aggregate an RGB value
How do laser printers work?
Laser printers use dry powdered ink called toner
A print drum is given a negative static charge
A laser shines a reverse image of the page at the drum
Laser light reverses the charge on the drum
Toner is charged negatively and sticks to positively charged image
Toner is transferred from drum to the paper and fused using a heat roller
What are some uses of RFID tags?
Security control points or identification of people, animals, goods or valuables
Shipping and supply chain tracking for goods
Banking and fast-payment systems
As a potential replacement for barcode systems
What are passive tags?
Passive transponders, used in bank cards for example, have no power source themselves and rely on the radio waves from the receiver for their energy
Transponders need to be placed very close to the receiver
What are active tags?
Active tags use a larger, battery powered beacon which can broadcast its own signal to receivers up to 300m away
These are more useful for larger items that are not placed on a receiver by hand, for example in shipping, toll stations, warehousing and control points
What is primary storage?
Primary storage is volatile and usually refers to RAM
What is secondary storage?
Secondary storage refers to non-volatile storage
Magnetic storage such as the hard disk
Optical storage that uses laser light such as CD-ROM
Solid state devices using Flash memory
What is inside a hard disK?
Concentric tracks are created on a magnetic disk
Disk spins at high speed: 3,600 – 7,200rpm
Spinning platters are each read by drive heads
Data is read or written as sector moves under the head
How do magnetic storage devices work?
Positive or negative polarisation of magnetic particles creates a binary pattern on the disk
Changes from negative to positive, or vice-versa creates electromagnetic pulses
Each pulse (or change) is read as a 1. Anything else is a 0
How do HDD’s work?
Fitting more data in the same physical space has required technological changes
More densely packed platters
Smaller magnetic parts and read/write heads
Perpendicular over longitudinal recording
What is disk latency?
Latency is the time taken to read/write disk data
This includes:
Seek delay - the time the head takes to move across the disk
Rotational delay - the time the disk takes to move to the correct sector underneath the read/write head
Transfer time to move the actual data
How do CD’s work?
A high powered laser “burns” pits into the CD surface
A low-powered laser detects the reflection from pits and lands
Only a pit end or start deflects the laser light to be read as a binary 1 by the light sensor
What are optical disk formats?
Optical disks are available as:
Read only
Recordable and
Re-writable formats
Each format uses slightly different techniques to achieve a differential between a ‘pit’ and a ‘land’
Recordable formats use a transparent dye that becomes opaque when heated by a laser
Re-writable formats use a laser to change the state of a phase-change alloy and a magnet to set the new state
Why are the capacities of CDs, DVDs and BluRay
different given they are all the same physical size?
Different laser wavelengths ‘burn’ smaller pits
The spiral track can therefore be more tightly wound, creating a longer track
How do NAND flash memory cells work?
Flash memory contains no moving parts
Floating gate transistors trap and store a charge
The charge is retained without power
How are flash memory cells combined?
Cells are combined in blocks
An electron trapped inside the middle layer reads as a 0, outside the middle is read as a 1
Data must be read, deleted or written in blocks
Data cannot be overwritten without being erased first
What is inside a solid state disk (SSD)?
A Solid State Disk comprises millions of NAND flash memory cells
Cells are also managed by a controller that organises pages and blocks of memory
These are arranged within an array of chips on a circuit board
What are the advantages of an SSD over a traditional Hard Disk
The advantages of an SSD over a traditional Hard Disk are as follows:
Faster access speed as there is no moving read/write head
Lower power consumption
Extended battery life in portable devices
Devices stay cooler
Less susceptible to damage
Silent in operation
Lighter in weight
What storage medium is best suited to field combat?
Software mailing
What are the properties of software mailing?
Often best suited to optical disks
Cheap to manufacture and distribute
Robust during carriage
Lightweight