Components of a CPU
Memory- The main memory of a computer can be thought of as a sequence of locations, each of which can store one value. Each value has a fixed width, i.e., a fixed number of bits.
Registers- A register is a very fast memory location inside the CPU. There are general purpose and special purpose registers.
arithmetic logic unit (ALU)- responsible for performing basic computations such as addition and multiplication, as well as Boolean logic operations, for example comparisons or AND and OR operations.
control unit (CU)- It coordinates the other components.
Registers in Marie
AC (accumulator): This is the only general-purpose register. For marie this is 16 bits long MAR MAR (Memory Address Register): Holds a memory address of a word that needs to be read from or written to memory. For marie this is 12 bits long (therefor marie has 4 bit opcodes) MBR MBR (Memory Buffer Register): Holds the data read from or written to memory. Marie- 16 bits IR (Instruction Register): Contains the instruction that is currently being executed. Marie- 16 bits PC PC (Program Counter): Contains the address of the next instruction. Marie- 12 bits
Marie – Number of memory locations
Number of memory locations = 212
Each of these memory locations can store a word ( 16 bits)
Memory Capacity = 212 * 2 bytes
control unit in the CPU performs the so-called ___cycle
fetch-decode-execute
Fetch- Update PC register, IR loaded with the current instruction.
Decode -Gets ready to execute the instruction by transferring data to MBR and updating MAR
Execute- Perform actual operation encoded by the instruction. Unique to each instruction.
Combination Circuits
In a combinational circuit, the outputs only depend on the inputs
Sequential Circuits
Sequential Circuit outputs depend on the inputs and on the sequence of events (i.e., inputs and outputs) that has happened in the past.
Comparators
perform Comparing functions, Used in executing SkipCond for Marie
Decoders
turns a binary number into a unary representation. n inputs and 2n outputs. Depending on the input only one output line would be activated,
Multiplexers
select one out of several data inputs. it has n selection inputs, which determine which one of 2n the data inputs to pick
memory-mapped IO architecture
specify and use some of the memory addresses to read from the keyboard and write to the screen. Using already existing instruction. Disadvantage: takes up from address space. (burrowed addresses no longer can access the ram) – Marie is this type
Instruction based IO architecture
It has additional special purpose instructions to input and output.
Interupt
The hardware notify the CPU when new data is available. The CPU then interrupts the program it is currently executing and jumps into a special subroutine to process the I/O request
DMA
Direct Memory Addressing: CPU delegate memory transfer operations to a dedicated controller. so that memory accessing not done though CPU operation.
Boot Process
BIOS
UEFI
UEIF Criticism
Operating Systems have the following core tasks
Managing multiple processes running in parallel. A process is a program that is currently being executed.
Managing the memory that processes use.
Provide access to file systems, the network and other I/O resources.
Process and Program
Program is the code written in programming language . A process, on the other hand, is created by loading the program code into the computer and then executing it. (Instance of a running program)
Abstraction
refers to hiding the complexity
virtualisation
OS can provide the “illusion” that each process ( refered to as virtualization)
has the CPU completely to itself (i.e., there are no other processes running)
has a large, contiguous memory just for itself
has exclusive access to system resources (i.e., it doesn’t have to worry about sharing these resources with other processes)
Operation System Virtualization Mechanism
Operating system Modes
User Mode
Kernel Mode
User Mode
Only a subset of instruction are allowed to be executed
IO instruction are not allowed
Certain memory operations are blocked
Normal applications run in this mode