0% found this document useful (0 votes)
7 views6 pages

Chap 4 - Rev

Chapter 4 discusses the functions and importance of operating systems, including memory management, multitasking, and handling interrupts. It explains the Von Neumann architecture, detailing the fetch-execute cycle and the roles of various components such as the control unit and arithmetic logic unit. Additionally, it covers the significance of interrupts in managing tasks and ensuring efficient processing in computer systems.

Uploaded by

louqman.huawei
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views6 pages

Chap 4 - Rev

Chapter 4 discusses the functions and importance of operating systems, including memory management, multitasking, and handling interrupts. It explains the Von Neumann architecture, detailing the fetch-execute cycle and the roles of various components such as the control unit and arithmetic logic unit. Additionally, it covers the significance of interrupts in managing tasks and ensuring efficient processing in computer systems.

Uploaded by

louqman.huawei
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Chapter 4

Chapter 4

Operating System

1. Functions of operating system.

- Provides a user interface - Manages the hardware

- Memory management - Manages file handling

- Processor management - Manages user accounts

- Provide utilities

- Multitasking // Multiprogramming

- Handling interrupt

2. Definition

Utility: A program that performs a specific task required for the operation of a computer system

Memory Management: A process of assigning blocks of memory to programs running in a computer

Spooling: Data are temporarily held in a buffer waiting for an output device to access it

Multitasking: Many processes appear to run simultaneously

3. Explain why PCs needs an operating system

-It performs a number of basic tasks, including controlling hardware or file handling
-It allows the user to communicate with the computer using hardware
-It provides the user with a user interface
-PC’s are often used to perform many complex tasks at a time
- The OS is needed to handle this multitasking, therefore, it provides the ability to handle interrupts
Interrupt/Buffer

1. Interrupt: A signal from a device sent to a computer causing the CPU to stop its current operation
temporarily

A signal sent from a device requesting the processor time. Interrupts have different priorities.

Purpose of an Interrupt:

- Used to make sure that important tasks are dealt with immediately
- The interrupt tells the CPU that its attention is required
- A signal that can be sent from a device (attached to the computer)
- A signal that can be sent from software (installed on the computer)
- The interrupt will cause the current process to pause
- The OS will service the interrupt
- After the interrupt is serviced, the previous process is continued
- It enables multi-tasking to be carried out on a computer
- Example printer out of paper

1
Chapter 4

Why interrupt is needed

- To identify that the processor's attention is required // to stop the current process/task
- To allow multitasking
- To allow for efficient processing // prioritising actions
- To allow for efficient use of hardware
- To allow time-sensitive requests to be dealt with
- To avoid the need to poll devices
What would happen if interrupt signals were not used in a computer.

- The computer would only start a new task when it had finished processing the current task
- Computer will not be able to multitask
-Errors may not be dealt with
- Computer would become impossible to use
Describe the role of an interrupt in generating a message on the computer that the paper has
jammed.

- Printer generates interrupt


-Interrupt is given a priority
- Interrupt is queued
- Interrupt stops CPU from processing current task
- CPU will service interrupt
- Generating an output message to state there is a paper jam

Devices that make use of interrupt:

- Keyboard
- Printer
- Mouse
Example when a printer would generate an interrupt signal

- A peripheral is connected/disconnected
- A key on a keyboard is pressed
- A mouse button click
- A phone/video call is received
- A buffer requires more data
- A printer has a paper jam
- A printer runs out of paper
- A printer runs out of ink
- When switching from one application to another
- Opening an application

2
Chapter 4

Software in the computer that will receive and manage all interrupt signals.
- Operating system
- Interrupt handler
- Interrupt service routine

Von Neuman Architecture

1. Stages of Von Neuman: Fetch – Decode - Execute

2. The stored program Von Neumann architecture


- The program is stored on a secondary storage device
- Data and instructions are moved to memory / RAM
- Data and instructions are stored in the same memory / RAM
- Data and instructions are moved to registers to be executed
- Instructions are fetched one at a time

Describe what is meant by the stored program concept.


- Instructions and data stored in the same memory
- Instructions fetched and executed one after another / in sequence

Q: Describe what is meant by main memory and how it is used in the Von Neumann model for a
computer system.

- RAM
- It is a Primary memory
- It is a Volatile memory
- Holds currently in use data/instructions
- Directly accessed by the CPU
Components in the Von Neumann model for a computer system

- Arithmetic and logic unit (ALU) - Memory address register (MAR)


- Memory data register (MDR) - Accumulator (ACC)
- Immediate Access Store (IAS) - Control Unit (CU)
- Program counter (PC) - Current instruction register (CIR)
- Address bus - Data bus
- Control bus - Input device // Output device

3
Chapter 4

Components inside the CPU

- Control bus - Memory address register (MAR)


- Memory data register (MDR) - Accumulator (ACC)
- Immediate Access Store (IAS) - Control Unit (CU)
- Program counter (PC) - Current instruction register (CIR)
- Address bus - Data bus

2. Types of Buses:

Bus: Pathway for transmitting data and instructions.

(i) Data Bus: Carries data that is currently being processed. Data can travel in both directions
(bidirectional)

(ii) Address Bus: Carries the address of the next instruction to be fetched. Data travels in one direction
(unidirectional)

(iii) Control Bus: Carries signals to control the actions of the processor. Data travels in one direction
(unidirectional)

- Carries signals from CPU to components.

- To synchronise the fetch-execute cycle

3. Types of Registers:

Register: Used to temporarily hold data and instructions during processing.

(i) MAR: Memory Address Register. Stores the address of the memory location which is about to be
accessed

(ii) MDR: Memory Data Register. Holds the instruction that is in use from address in MAR.

(iii) PC: Program Counter. Stores the address of the next instruction to be executed.

(iv) CIR: Current Instruction Register. Stores the current instruction being executed

(v) Accumulator: Holds data temporarily that is currently being used in a calculation.

Immediate Access Store: Used to hold data and instructions before they are processed.

Q: Explain the use of the registers in the fetch-execute cycle

- Temporary storage
- To store addresses
- To store data/instructions
- PC stores address of next instruction
- MAR stores address of instruction to be fetched
- MDR stores data from the address in MAR
- ACC stores interim results of calculations/data to be used in calculations
- CIR stores the current instruction being processed

4
Chapter 4

4. Control Unit:

- Controls operation of memory, processor and input/output

- Instructions are interpreted

- Sends signals to other components telling them ‘what to do’

- Responsible for decoding instructions

5. Arithmetic Logic Unit

- Carries out calculations

- Carries out logical operations

- Hold temporary values during calculations in a register called the accumulator (ACC)

6. A section of computer memory is shown below:

Address Contents

1000 0000 0110 1110

1000 0001 0101 0001

1000 0010 1000 1101

1000 0011 1000 1100

1000 1100

1000 1101

1000 1110

1000 1111

(a) (i) The contents of memory location 1000 0001 are to be read.
Show the contents of the Memory Address Register (MAR) and the Memory Data Register (MDR) during
this read operation: (2)

MAR 1 0 0 0 0 0 0 1

MDR 0 1 0 1 0 0 0 1

(ii) The value 0111 1001 is to be written into memory location 1000 1110.
Show the contents of the MAR and MDR during this write operation: (2)

MAR 1 0 0 0 1 1 1 0

MDR 0 1 1 1 1 0 0 1

5
Chapter 4

7. Von Neumann fetch-execute cycle: PC


1. The address contained in the Program Counter (PC) is copied to the Memory Address Register (MAR)
2. The instruction is copied from the memory location contained in the Memory Address Register (MAR)
and is placed in the Memory Data Register (MDR) MAR

3. The instruction is copied from the Memory Data Register (MDR) and placed in the Current Instruction
Register (CIR)
MDR
4. The value in the Program Counter (PC) is incremented so that it points to the next instruction to be
fetched
5. The instruction is decoded CIR

6. The instruction is executed

PC + 1
8. Explain how an instruction is fetched in a computer based on the Von Neumann model
- PC holds address of the instruction
- The address held in PC is sent to MAR using address bus Decode

- MAR goes to location in memory where instruction is stored


- Instruction sent to MDR using data bus
Execute
- Instruction sent to CIR
- Control unit sends signals to manage the process using the control bus

You might also like