Chapter 4 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the three main sections a computer system consists of?

A
  1. CPU (/processor): the main processing unit
  2. Storage
    i. Primary (/main) memory: RAM and ROM, cache memory and registers
    ii. Secondary storage – Hard drives, CD-ROMs
  3. Input and Output devices: allow interaction with the computer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the components of the CPU?

A

▪ Arithmetic Logic Unit (ALU)
▪ Control Unit (CU)
▪ System Clock
▪ Immediate Access Store (IAS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the Arithmetic Logic Unit (ALU) do?

A

Allows
• Arithmetic operations: addition, subtraction, multiplication, division
• Logical operations (comparing one data item
to another)
Caried out while a program is running

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the Accumulator (ACC)?

A

Accumulator (ACC) is the register used to store
values when carrying out ALU calculations – it is
inside the ALU

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the Control Unit (CU) do?

A

▪ CU ensures synchronization by sending out signals along the control bus to control operations while fetching, interpreting and executing instructions

▪ Tells the other computer components what to do (input/output, flow of data)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the System Clock do?

A

▪ Sends out a number of pulses in a given time
interval on the control bus to ensure synchronisation takes place

▪ An electronic pulse of the CPU is called Clock cycle

▪ Each processor instruction takes a certain
number of clock cycles to execute
▪ The higher the clock frequency, the shorter the
execution time for the instruction// Increasing
the clock frequency improves performance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What purpose does the Immediate Access Store (IAS) have?

A

▪ Stores all the data and programs that the processor needs to access
▪ Done by the CPU temporarily
▪ Read/write operations carried out using IAS is faster than read/write operations to backing store

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are registers?

A
  • Small pieces of fast memory where data is stored temporarily
  • Part of the processor
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the difference between general purpose registers and special purpose registers?

A

General Purpose:
• Hold data that is frequently used by the CPU or can be used by the programmer when addressing the CPU directly
• Example: Accumulator (ACC)

Special Purpose:
• Have a specific function within the CPU and hold the program state
• Example: CIR, IX, MAR, MDR, PC , SR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the purpose of the Current Instruction Register (CIR)?

A

Stores the current instruction being decoded and executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the purpose of the Index Register (IX)?

A

Used when carrying out index addressing operations

assembly code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the purpose of the Memory Address Register

(MAR)?

A

Stores the address of the memory location currently being read for or written to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the purpose of the Memory Data Register (MDR/MBR)?

A

Stores data which has just been read form memory or data which is about to be written to memory (sometimes referred to as MBR)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the purpose of the Program Counter (PC)?

A

Stores the address where the next instruction to be read (fetched) can be found

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the purpose of the Status Register (SR)?

A

Contains bits which can be set or cleared depending on the operation (e.g.: to indicate overflow in a calculation)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a status register?

A

▪ Contains different bits/flags (each flag takes one bit with 0 or 1 value)
▪ Used when an instruction requires some form of arithmetic or logical
processing

Examples of flags
▪ Negative flag (N) : set to 1 if the result of a calculation yields a NEGATIVE value
▪ Overflow flag (V) : set to 1 if an arithmetic operation results in an OVERFLOW
▪ Zero flag (Z) : set to 1 if the the result of an arithmetic/logic operation is ZERO

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Where are the PC and CI registers found?

A

PC and CI registers are in the control unit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Where are the MDR and MAR found?

A

MDR and MAR are in the processor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Explain the Fetch-Decode-Execute cycle:

A

Fetch:
Fetches the next instruction and any data involved from main memory and stores them in registers

Decode:
Decodes (interprets, understands) the instruction

Execute:
Executes the instruction – sends control signals to the appropriate components of the computer system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is a program?

A

A program is a set of instructions stored in a

sequential block of main memory locations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How are the registers during the fetch execute cycle utilized?

A

▪ Current Instruction Register (CIR) : Contains the current instruction being processed
▪ Program Counter (PC) : Contains the address of the next instruction to be executed
▪ Memory Address Register (MAR)
▪ Memory Data Register (MDR)
▪ General Purpose Registers: Holds data, such as numbers during arithmetic calculations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

The steps in the fetch-execute cycle:

A

1) PC (Program Counter) register holds the address of the next instruction to be executed
2) CPU copies the address contained in the PC to the MAR via the address bus
3) The contents, the instruction, of the memory location contained in the MAR is then copied to the MDR
4) The contents, (the instruction) is then copied from the MDR and placed in the CIR
5) the value in the PC is then incremented so that it points to the next instruction to be fetched
6) the instruction is finally decoded and is then executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

The fetch-execute cycle using RTN

A
  1. MAR ← [PC] (Address stored in PC stored in MAR)
  2. PC ← [PC] + 1 PC (points to the next address-is incremented by 1)
  3. MDR ← [[MAR]] (Contents found in address stored in
    MAR transferred to MDR)
    - Double brackets means the data stored at the address shown in MAR that is being copied
  4. CIR ← [MDR] (Contents of MDR transferred to CIR)
  5. Decode
  6. Execute
  7. Go to Step 1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is an interrupt?

A

A signal from a program or device telling the processor its attention is needed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What can cause interrupts?

A

o Timing signal
o Input/output processes (e.g. disk drive ready to receive more data)
o Hardware fault (e.g.: paper jam, out of paper)
o User interaction (e.g.: Ctrl+Alt+Break keys to interrupt a process)
o Software error (e.g.: .exe not found, division by zero)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What happens when there’s an interrupt during the fetch-execute cycle?

A
  1. At the end of each fetch–execute cycle the processor checks for interrupt(s)
  2. Checks if an interrupt flag/bit is set (in interrupt register).
  3. Processor identifies source of interrupt
  4. Checks the priority of interrupt.
  5. If the interrupt priority is high enough
    - Processor saves current contents of registers and
    - Calls interrupt handler / Interrupt Service Routine (ISR)
    - Address of ISR is loaded into Program Counter (PC)
    - When servicing of interrupt complete, processor restores registers
  6. Lower priority interrupts are re-enabled
  7. Processor continues with next F–E cycle
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What is a bus?

A

A bus is a set of parallel wires connecting two or more components of the computer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Address bus:

A

Carries signal relating to addresses of main memory locations or input/output device to be used between the processor and memory

Unidirectional (addresses travel in one direction only) – from the processor to MAR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Data bus:

A
Sends data between the processor, the
memory unit (and the input/output devices)

Bi-directional (data can travel in both
directions). Data is carried from CPU to
memory (and vice versa) as well as to and
from input/output devices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Control bus:

A

Carries signals relating to the control and coordination of all activities within the computer (e.g.: read and write functions) from CU to all the other computer components

Bi-directional. It carries signals from the CU to all the other computer components

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What happens when we increase the bus address width?

A

The wider the data bus, the larger the number of bits (word length) that can be transported simultaneously at one time.

Increasing the width of address bus increases the performance of a computer system as fewer transfers are needed (increases the performance of a computer system)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What factors can affect a computer’s performance?

A
▪ Clock cycle/speed
▪ Width of the address bus and data bus
▪ Overclocking
▪ Cache memory
▪ Number of cores
33
Q

What is meant by overclocking?

A

• Clock speed can be changed by accessing the BIOS.
• But, clock speed higher than that the computer
was designed for can lead to:
- Instruction is unable to complete in time before the next one is due to be executed → unsynchronised
operations
- Serious overheating of CPU → unreliable performance

34
Q

What is cache memory?

A
  • A type of high-speed RAM which is built into the CPU – faster access times
  • Holds the most frequently used instructions and data for faster access
35
Q

What is meant by number of cores?

A
  • Dual core or quad core
  • Doubling the number of cores does not imply improvement of computer performance b/c CPU needs to communicate with each core → reduces overall performance
36
Q

What are computer ports?

A

▪ I/O devices are connected to computer via ports
▪ Interaction of the ports with the I/O devices is controlled by the CU

▪ Most common types of ports (on modern computers)
o USB ports
o HDMI
o VGA

37
Q

What is the Universal Serial Bus (USB) port?

A

▪ An asynchronous serial data transmission method

▪ The standard method for transferring data between a computer and a number of devices
▪ Essentially, the USB cable consists of a four-wire shielded cable:
- two for power and the earth
- two used in the data transmission

38
Q

+ of USB?

A

Devices plugged into the computer are automatically detected: device drivers are automatically uploaded

The connectors can only fit one way; this prevents incorrect connections being made

Has become the industry standard; considerable support is available to the users

Several different transmission rates are supported

Newer USB standards are backward compatible with older USB standards

USB 3.0 allows full duplex data transfer

Allows power to be drawn to charge portable devices

39
Q
  • of USB?
A

Present transmission rate is limited (less than 500 Mbps)

Maximum cable length is about 5 metres

The older USB standard (e.g. 1.1) may not be supported in the near future

40
Q

What does the High-Definition Multimedia Interface (HDMI) port do?

A

▪ HDMI ports allow output (audio & visual) from a computer to an HDMI–enabled device
▪ Support high definition signals
▪ Replaced VGA

41
Q

What is the Video Graphics Array (VGA) port?

A

▪ Analogue technology

▪ Supports 640x480 pixels

42
Q

+ of HDMI?

A

Standard for modern televisions and monitors

Very fast data transfer rate

Improved security

Supports modern digital systems

43
Q
  • of HDMI?
A

Easy to break connection when moving

Limited cable length to retain good signal

5 cable/connection standards

44
Q

+ of VGA

A

Simpler technology

Only 1 standard available

Easy to split signal and connect a number of devices from 1 source

Secure connection

45
Q
  • of VGA
A

Out-dated

Easy to bend the pins when connecting

Cables must be of high quality to ensure good signal

46
Q

What is machine code?

A

▪ CPU only uses machine code, which is binary
(sometimes displayed on screen as hex)
▪ Each different computer type has its own set of machine code instructions
▪ Each machine code instruction performs a single task, e.g.: storing a value in a specified memory location
▪ Writing machine code:
- Time consuming
- Error prone

47
Q

What is assembly language?

A

▪ Low-level machine specific programming language that uses mnemonics

▪ Structure of assembly – each instruction has:

  • Opcode (operation code): identifies the operation to be carried out by the CPU
  • Operand: identifies the data to be used by the opcode (not all instructions have this)
48
Q

What does the assembler do?

A
  • It translates each assembly language instruction into a machine code instruction
  • It checks the syntax of assembly language – ensuring that only opcodes of the appropriate machine code instruction set are used
49
Q

What are the 2 types of assemblers?

A
  1. Single Pass Assemblers

2. Two Pass Assemblers

50
Q

What do single pass assemblers do?

A

▪ Puts the machine code instructions straight into the computer memory to be executed

51
Q

What do two pass assemblers do?

A

▪ Produces an object program in machine code that can be stored, loaded and executed at a later stage
▪ The source program is scanned twice, so that labels in assembly can be replaced with memory addresses in machine code

52
Q

What happens in the first pass of the two pass assembler?

A

!A symbol table is created (labels are added to the table along with the address, if the address is known)!

  • Read the assembly language program one line at a time
  • Ignore anything not required (ex comments)
  • Allocate a memory address for the line of code
  • Check the opcode is in the instruction set
  • Add any new labels to the symbol table with the address, if known
  • Place address of labelled instruction in the symbol table
53
Q

What happens in the second pass of the two pass assembler?

A

!An instruction (/opcode/mnemonic) table is created!

  • Read the assembly language program one line at a time
  • Generate object code, including opcode and operand, from the symbol table generated in Pass 1
  • Save or execute the program
54
Q

What are some special features of the assembly language program?

A
▪ Comments
▪ Symbolic names for constants
▪ Labels for addresses
▪ Macros
▪ Subroutines
▪ Directives
▪ System calls
55
Q

What is an assembly language macro?

A

▪ A group of instructions given a name (// subroutine)
▪ Need to be executed several times within the same program
▪ The statements are written once and called using the name whenever they need to be executed.
▪ Macro code is inserted into the source file at each place it is called

56
Q

What are the two steps when using macros in an assembly program?

A

1: Defining a macro:
- The definition of a macro consists of three parts: the header, body, and terminator

MACRO The header
. . . . The body: instructions to be executed
ENDM The terminator

2: Invoking a macro by using its given on a separate line followed by the list of parameters used if any:

[parameter list]

57
Q

What is a directive in assembly language?

A

▪ An instruction that directs the assembler to do something
▪ Not a program instruction; It is information for the assemble
▪ Instructs the assembler as to how it should construct the final executable machine code: directing how memory should be used or defining files or procedures that will be used

58
Q

Examples of what directives do:

A

▪ Some tell the assembler to set aside space for variables
▪ Others tell the assembler to include an external source files
▪ Others establish the start address for your program

59
Q

What is the difference between assembly instructions vs assembly directives?

A

▪ Assembler instruction generates machine code

▪ Assembler directive does not create machine code: it directs the assembler to perform certain actions during assembly phase.

60
Q

Name the groups that a processor’s instruction set can be grouped into?

A
  1. Data movement
  2. Input and output of data
  3. Arithmetic operations
  4. Unconditional & conditional instructions
  5. Compare
61
Q

What do data movement instructions do?

A
▪ Allow data stored at one location to be copied into the accumulator
▪ LDM
▪ LDD
▪ LDI
▪ LDX
▪ LDR
▪ MOV
▪ STO
▪ END
62
Q

What do input & output data instructions do?

A

▪ Allow data to be read from the keyboard or output to the screen
▪ IN
▪ OUT ** No opcode

63
Q

What do arithmetic operation instructions do?

A
▪ Perform simple calculations on data stored in the accumulator and store the answer in accumulator (overwriting the original data)
▪ ADD
▪ SUB
▪ INC
▪ DEC
64
Q

Examples of unconditional & conditional instructions?

A

▪ JMP
▪ JPE
▪ JPN
▪ END

65
Q

Examples of compare instructions?

A

▪ CMP

▪ CMI

66
Q

What are the addressing modes?

A
▪ Absolute addressing 
▪ Direct addressing 
▪ Indirect addressing 
▪ Indexed addressing 
▪ Immediate addressing 
▪ Relative addressing 
▪ Symbolic addressing
67
Q

What does absolute/direct addressing do?

A

▪ The operand refers directly to a memory location

68
Q

What does indirect addressing do?

A

▪ The contents of the contents of the memory location in the operand are used

69
Q

What does indexed addressing do?

A

▪ The operand is used to form an address:

operand + the contents of the Index Register (IX)

70
Q

What does immediate addressing do?

A

▪ The operand is the actual value to be loaded

71
Q

What does relative addressing do?

A

▪ The operand is added to the base address (current address) to give the actual address

72
Q

What does symbolic addressing do?

A

▪ The operand is a label that represents the memory location

73
Q

What does a logical left shift do?

A

▪ Logical left shift moves each bit in a word one/more bit position(s) to the left.

▪ Zeros are introduced on the right-hand end

▪ A left shift moves the bits to more significant positions (like multiplying by two)

!Does not preserve the sign of the word (positive or
negative)!

74
Q

What does a logical right shift do?

A

▪ Logical right shift moves each bit in a word one/more bit position(s) to the right.

▪ Zeros are introduced on the left-hand end

▪ A right shift moves them to less significant positions (like dividing by two)

!Does not preserve the sign of the word (positive or
negative)!

75
Q

What can arithmetic shift operations be used for?

A

▪ They can be used for dividing or multiplying an integer variable

76
Q

What does a cyclic shift do?

A

▪ The digits dropped off at one end of a word are returned at the other end of the word (in a circle/loop)
▪ No bits are lost

77
Q

How are logical shifts represented in assembly instructions?

A

▪ LSL n -> n places to the left

▪ LSR n -> n places to the right

▪ Shifts are always performed on the ACC

78
Q

What does bit manipulation in monitoring and control aid in?

A

▪ In monitoring and control, each bit in a register or memory location can be used as a flag and would need to be tested, set or cleared separately
Example: act as sensors to detect when data has been processed

▪ Represented by 1 bit ➔ 8-bit register

▪ The instructions:

  • AND used to check if the bit has been set
  • OR used to set the bit
  • XOR used to clear a bit that has been set
79
Q

What is a bitmask?

A

▪ A bitmask is a way of accessing a particular bit
▪ The bitmask is a number which has 0 in all bits that we don’t care about, and a 1 for the bit(s) that we want to examine
▪ By ANDing the bitmask with the original number, we can “extract” the bit(s)