OS & System Programming Flashcards
Revise This Module for Exams
What is Von Neumann Architecture also known as?
Stored-program computer
What is a Stored-program computer
A computer that stores program instructions in memory
Does Reprogramming require any change in hardware?
NO
What are the Architecture 3 main components?
- CPU
- Memory
- I/0 Interface
What is the CPU?
Heart of the Computing System
Includes:
- Control Unit (CU)
- Arithmetic Logic Unit (ALU)
What is Memory?
The computer’s memory stores program data & instructions
What I/O Interfaces?
They are used to receive or send information from the connection.
- Connected devices are called peripheral devices.
How are programs executed on Von Neumann Computers?
- Program is stored in memory
- Translated in Machine code
1) CU understands that data needs to be provided by the user.
2) Data is Read from input device & bought to the CPU
What is ALU?
Union of the circuits for performing Arithmetic & Logical Operations
What is CU role?
Responsible for step-by-step execution of instructions during a program execution.
What are Registers?
- Small storage element, located close to ALU
- Used as temporary storage during computation
- ALU can read & write from Registers very fast
What are the advantages of using Registers?
- Fast, does computation in Registers without constantly storing new values
- Improves processing speed
- Allows us to read data from memory once(Registers Store Immediate Data)
- Reading Registers tend to have zero-time overhead
Does CPU need Registers?
No, can use memory to store all the data
How long does it take to read/write data?
4ms
How long does Arithmetic take?
1ms
How is Memory Organised?
- Memory consists of small ‘cells’
- Each cell stores a small piece of data
- cells have addresses 0 to n-1
Memory Access?
- Read & Stores operations, CPU generates addresses
- Memory Management unit reads or writes from/to memory location
Decimal Representation :
- Base 10 system
- 0-9 are digits
Binary Representation:
- Base 2 System
- digits are 0&1
- digits called ‘bits’
- 8 ‘bits’ are called a ‘byte’
eg: 1110 = 14
Hexadecimal Representation:
- Base 16 System
- Digits: 0,12,3,4,5,6,7,8, A,B, C,D, E, F
e.g : A3B = 2114
What is the General Structure of a C Program?
- Execution begins at main()
- Header of file contains imports / pre-defined libraries
Examples of Control Flows?
- if statements: conditional computation
- if-else : Multiple Branching
- Switch Statements
- For / while/ do-while loops
Basic if statement implementation?
if (condition) {
statement;
}
Example of if-else
if (condition) {
statement;
}
else if (condition) {
statement
}
else{
statement
}