computer organizaiton (week 3) Flashcards
what is a program
program is a source file that contains many lines of instructions.
it is written in a high level programming language such as C, java, python
how are programs executed
high level language –> low level language (assembly language) –> machine language(binary)
computers execute ______
machine language
What is the von Neumann architecture
Has a fixed set of electronic parts, which can be manipulated to perform various tasks determined by a variable program.
The parts are:
- cpu
- primary memory unit
- collection of I/O devices
- buses to interconnect the components
what does the CPU contain?
ALU
control unit
what does the ALU do
–> responsible for performing artihmetic and logical operations
ALU comprises of ?
–> comprises of functional unit that performs operations
–> registers that loads and saves data to and from the primary memory. 32 to 64 bit registers to hold 32-bit data
how are computations accomplished in ALU
–> Loading binary values into registers
–> performing operations on the registers using the function unit
–> storing the result back into a general register
–> saving the register contents back into memory
what is the control unit
causes a sequence of instruction to be stored in memory to be retrieved
what does the control unit comprise of?
fetch unit
decode unit
execute unit
instruction registrar
program counter register
control unit works based on the __________ cycle
fetch execute cycle
what is fetch unit
fetches an instruction from memory
what is decode unit
decode an instruction
what is execute unit
signals ALU to execute instruction
what is instruction registrar
contains a copy of the current instruction
what is program counter registrar (PCR)
contains the memory address of the next instruction the unit is to load.
What happens in the fetch phase of the control unit operation
Instructions are retrieved from the memory
What happens during the execute phase of the control unit
ALU operations start happening
Cause memory data reference, I/O operations
What is the primary memory unit
Stores both programs and data while they are being operated on by the cpu
Interface between memory and cpu consists of _______ registers
3
What are the 3 interfaces that memory and cpu interface consist of
Memory address register
Memory data register
Command register
Primary memory unit is also referred to as
Random access memory
How does primary memory unit store data
Stores programs and data in binary format
What is the memory address register
Stores addresses of data to be read from or written to
What is memory data register
Stores data that is read or to be written
What is command register
Stores the command to be executed
How does the primary memory work
Load mar with data
Load command with read
Data will appear in mdr
What is device controller
Each device is controlled by a device controller
The device controller connects the device to the computers’ address and data bus
Provides an interface that the OS (device manager) can use to manipulate the device
______ varies among controllers
interface
OS provides ______ to hide the differences from the programmer
abstractions
what does the device driver provided by controller do ?
Allows the OS to operate and synchronize its behaviour with the device operation
how to determine when the I/O is complete
2 ways:
polling
Interrupt
what does the device controller include as part of the interface
data registeres
command registers
status flags which includes done, busy or error
what is polling
–> simplest way to keep polling the device to see the state of the I/O
–> device implements the status of the device as a flag
–> If the I/O is not done, the CPU executes a busy wait command to wait for the I/O to end, but the CPU is effectively waiting and doing nothing
what is the advantage of polling
it is a simple implementation
what is the disadvantage of polling
waste of CPU resource
what is interrupt
–> CPU implements an interrupt request flag
–> when the device IO is completed, the device sets the interrupt request flag to signal the end of the IO
–> CPU, on its fetch cycle, would detect the flag and proceed to execute a set of routines to service the IO
what is advantage of interrupt
minimize the cpu idle time
no need to keep polling the device
what is the disadvantage of interrupt
complex implementation
what is dma
dma stands for direct access memory and it allows data transfer between I/O devices and memory without CPU intervention.
cpu can start a dma block transfer and then
perform other work in parallel with the DMA
operation. This can significantly increase the
machine’s I/O performance.w