Category: Computer Structure

N5 – CS – Computer Structure

Describe the purpose of the basic computer architecture components and how they are linked together:

Processor

  • Control Unit – controls the sequencing of fetching, decoding and executing instructions.
  • Arithmetic Logic Unit – performs all calculations and logical operations
  • Registers – temporary memory locations within the processor.

 

Memory locations with unique addresses

  • All memory locations within RAM is given a unique address so that the computer can read and write data to that location correctly.

Buses

  • Buses are used to move data around as binary inside the computer system
  • Address Bus – this transfers the memory location that is going to read from or written to.
  • Data Bus – this transfers the data between the processor and memory, and vice-versa.

 

Explain the need for interpreters and compilers to translate high-level program code to binary.

  • Computers can only understand binary and therefore all instructions must be translated into binary before they can be executed.
  • Interpreter – translates one program line into machine code and executes immediately. Machine code is not retained, so must be translated each time, the Interpreter must therefore be resident in memory.
    • Good for testing, errors are highlighted straight away.
  • Compiler – All lines are translate to machine code, this machine code version is then saved and can be executed. Machine code can be run again, and again without further translation.
    • Used for programs that are ready for release.

N5 – Low-level operations and computer architecture

Explanation of the need to translate high-level program code to binary (machine code).  
Computers can only understand binary code, therefore all human readable programming codes have to be translated into binary. Binary code which contains machine specific instructions is called machine code. A machine code file will only work on the computer type it was created for. Therefore one program does not work on different systems (X Box and Play Station)
Comparison of interpreters and compilers.  
Interpreters – These are resident in the computer’s memory when the program is executed. These translate the source code (program) one line at a time into machine code, this can make them appear slow. Syntax errors are often highlighted as they are made.

Compilers – These translate the source code into machine code, this machine code can then be saved and executed without further need for the compiler. Making the program appear to execute faster than the interpreted version. Syntax errors are only apparent at run time.

Description and exemplification of the use of binary to represent positive integers.  
Binary is a base 2 numbering systems where every digit can have two values ( 0 / 1 )

This is because computers can only represent information using electricity which is either on (1) or off (0)

Conversion from Binary to decimal and vice-versa.  
To convert a decimal number to a binary number, we need to start at 1 and double it.

128 64 32 16 8 4 2 1
0 0 1 0 1 0 1 0

So the number above is 42 ( 32+8+2)

Description of floating point representation of real numbers using the terms mantissa and exponent.  
Binary can only store a whole number so to store a real number we use floating point notation. MxBe. The Base is 2 for binary.

The Mantissa stores the number itself and therefore controlling the accuracy.

The Exponent store the magnitude of the number and therefore controls the range.

Mantissa Range Exponent Accuracy (MARE)

Description of ASCII code (7-bit) used to represent characters.  
American Standard Code for Information Interchange.

Every letter is given a number (A = 65) this is then stored as binary. This allows us to store 128 different symbols and commands, this allows for messages and documents to be read by different computer systems. The 1st 32 numbers are reserved for non-printing characters, such as TAB and RETURN.

Description of the vector graphics method of graphic representation.  
Vector Graphics store pictures as a series of objects and their attributes.

To draw a red circle we would need a circle object and then describe it with attributes.

<circle cx=”50″ cy=”50″ r=”40″ stroke=”black” stroke-width=”3″ fill=”red” />

This is very useful for storing non-photographic work as it can be scaled up without losing quality.

Description of the bit-mapped method of graphics representation.  
Bitmap graphics store images as a grid of pixels (Picture Elements). These pixels values can be changed to display an image. Bitmaps can require a large amount of storage, especially when using colour. The greater the number of pixels the higher the resolution therefor the larger the file size.
Describe the purpose of the Basic computer architecture components and how they are linked together including:  
processor  
The processor is the part of the computer which execute the program, controlling the hardware and software of the computer system. It is composed of three parts.

Control Unit, Arithmetic and Logic Unit, and Registers

CU, Ah Luv U, Right.

control unit  
This is the part of the processor which controls the execution of the program. It uses a clock pulse to sync all parts of the computer, measured in Hertz (Hz). This is often used to measure the speed of a computer. You would expect a 3GHz computer to be faster than a 1GHz computer.
Arithmetic and Logic Unit (ALU)  
This part of the processor performs calculation and is used to evaluate logical decisions (AND OR NOT)
registers  
This is a temporary storage area inside the processor. It is used to store instructions, memory locations or values currently in use. Resetting a processor will clear these values.
memory  
Computer memory can either be RAM or ROM.

Random Access Memory is used to store the data currently being processed, it is volatile meaning that its contents are lost when the power is turned off.

Read Only Memory is used to store programs or data that cannot be changed, such as the operating system or serial number. Contents are not lost when power is removed.

Units of storage

  • bit
  • Byte
  • KB
  • MB
  • GB
  • TB
  • PB
 

  • bit = Binary Digit (0 or 1)
  • 1 Byte = 8 bits
  • 1 KiloByte = 1024 Bytes
  • 1 MegaByte = 1024 KB
  • 1 GigaByte = 1024 MB
  • 1 TerraByte = 1024 GB
  • 1 PetaByte = 1024 TB

 

 
Data Bus  
This is used to carry data from the processor to peripherals (other parts of the computer) and vice versa. The data bus is therefore a bi-directional bus. A bus is simply a group of wires.
Address Bus  
This is used to carry the location of the data from the processor to memory and peripherals. This is a Unidirectional bus.
Interfaces  
An Interface is a hardware device that compensates for differences between the processor and peripheral devices. For example, sound data is analogue and the interface would need to change it to digital before it could be used. There are a number of common interfaces, which are disused later.

Higher – Low-level Operations and Computer Architecture (Revision)

  • Virtual Machines: an emulation of a complete computer system which can be used to run alternative operating systems, or several copies of a single operating system
  • Emulators: software which duplicates the function of one computer system in another
  • Mobile Devices: features which require different types of software from conventional desktop systems eg touchscreen, pinch
  • Binary Representation of:
    • Integers – 163: 1 0 1 0 0 0 1 1
    • Negative Integers – -93: 1 0 1 0 0 0 1 1
    • Real numbers – 16.25: Mantissa & Exponent
      Stored using a mantissa (Larger = greater accuarcy) and an exponent (Larger = greater range)
    • Characters
      • ASCII (American Standard Code for Information Interchange) stores each letter, number or symbol using a number code from 0 to 127; ASCII uses eight bits (1s and 0s) to store each character
      • UNICODE 16bits, larger pool of characters
    • Instructions – represented by machine code as 0s and 1s
    • Vector Graphics – stored as a collection of mathematically determined shapes or objects; each object in the picture has properties such as width, height, fill colour, line colour eg
      <rect height=”96” width=”128” y=”3” x=”90” stroke-width=”6” stroke=”#cc0000” fill=”#ffcc33” id=”yellowrectangle”>
    • Bitmap Graphics – made up of a grid of pixels and stored in memory as a bit pattern of ones and zeros (calculations are mentioned later in this booklet)bm
    • Sound – sample rate (the number of times the value of the signal is recorded) and its bit depth (the number of bits used to store the sample)
    • Video – storing video requires both images and sound to be stored together; files will be very large as a result so compression is always used unless the video is being recorded for editing later; each frame in an MPEG video is compressed as a JPEG; the data that stays the same in successive frames is then removed
  • Processor: consists of several different parts:
    • the Arithmetic and Logic Unit which performs calculations;
    • the Control Unit which loads, decodes and executes instructions,
    • Registers which are small memory locations used by the processor
  • Cache: a faster kind of memory which stores copies of the data from frequently used main memory locations
  • Read Only Memory: Permanent memory; data is not lost when power switched off; this memory is very important and is used to store programs, like the operating system, for a long time
  • Random Access Memory: used to hold all data required for an active program or application to run; data is transferred from backing storage to RAM and held there until it is no longer required by the processor
  • Address Bus: identify the address of the location in cache or main memory that is to be read from or written to; uni-directional
  • Data Bus: will transfer data to/from the address that is held on the address bus; bi-directional; the amount of data that can be carried by the data bus depends on the word size (width of the data bus)
  • Interfaces: used to allow peripheral devices and hardware to connect to a computer system; allow for differences in speed and the way that data is handled by each peripheral device; an example is a USB; responsible for voltage conversion, status signals, data format conversion

National 5 – Low-level operations and computer architecture (Revision)

Units of storage:

8 bits = 1 byte
1024 bytes = 1 Kilobyte
1024 Kilobytes = 1 Megabyte
1024 Megabytes = 1 Gigabyte
1024 Gigabytes – 1 Terabyte
1024 Terabytes = 1 Petabyte

Translation of high-level program code to binary (machine code):

  • interpreters – translates source code to machine code line by line, spots errors more easily but takes longer.
  • compilers – translates the source code to machine code in one step, does not spot errors as line being typed, but more efficient. Creates a run time version (object code) that can’t be edited.

Use of binary to represent and store:

  • Real numbers uses mantissa & exponent – 0.256 X 105
    Mantissa = 256 Exponent = 5
  • Characters – ASCII allocates a different binary code to each letter, A = 00100001
  • Instructions, machine code – Binary instructions the processor can understand 10101011101
  • Graphics bit-mapped and vector
    • Bit-mapped graphics are made up of pixels
    • Vector graphics are described in text <rect width=”300″ height=”100″ style=”fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)”>

Basic computer architecture:

  • Processor (CU Ah Luv U Right)
    • Registers – temporary storage locations holding data being processed
    • ALU – deals with comparisons and arithmetic calculations
    • control unit – controls all other parts of the processor, ensures instructions are carried out in the correct order
  • Memory
    • Random Access Memory – temporary data storage only held as long as the computer is switched on.
    • Read only memory – Permanent memory not lost when the computer is switched off, can’t be changed.
  • Buses
    • data – carries data to and from the processor, memory and other devices. Bi-directional
    • address – carries address info from processor to the memory.
    • control – made up of a number of separate wires.
  • Interfaces
    • allows a processor to send and receive data to and from peripherals like printers, scanners, keyboards and projectors.
    • Bluetooth – Wireless
    • USB – Wired

Low-level operations and computer architecture

  • Units of storage: bit, byte, Kilobyte, Megabyte, Gigabyte, Terabyte, Petabyte
  • Translation of high-level program code to binary (machine code): interpreters and compilers
  • Use of binary to represent and store:
    • Integers
    • Real numbers (mantissa & exponent)
    • Characters
    • Instructions (machine code)
    • Graphics (bit-mapped and vector)
  • Basic computer architecture:
    • Processor( registers, ALU, control unit)
    • Memory
    • Buses (data and address)
    • Interfaces

Read more

S4 – Homework w/b 24th Nov

Hardware

1   State what RAM stands for. 1

2   Name the part of the processor which stores data temporarily, eg instructions before they are executed?                                                                                                1

3   Which bus holds the number of the storage location the processor needs to locate data in  RAM? 1

4   Name the other 2 parts of the processor not mentioned in Q2. 2

5   Draw the simple block diagram of the computer system. 3

8 marks