Topic 4/5 Theory Flashcards
Drawbacks of Sign-Magnitude Representation
two representations of 0
need to consider sign bit and magnitude to carry out operations
Why not connect peripherals directly to system bus ( Why use I/O)
Peripherals have different data formats and length, speed mismatch leads to inefficiency
Human readable
Communicating with computer
Machine readable
communicating with equipment
Communication
communicating with remote devices
Four types of I/O commands from CPU
Control,Test,Read,Write
Control: activate peripheral and tell it what to do
Test: test status condition of i/o and peripheral
Read: get data from peripheral -> data registers of I/O -> Data bus
Write: get data from data bus -> data registers of I/O -> peripheral
Addressing modes of I/O
memory-mapped I/O and Isolated I/O
Memory-mapped I/O
Single address space for memory and I/O device. CPU uses the same way to access both memory and I/O
Isolated I/O
separate address space for I/O and memory.
Need select lines to indicate address to I/O or memory
Context switching
When interrupt occurs, Program counter of ISR loaded,
Current CPU context is saved in stack.
Stack pointer - points to the top of the stack, where the current context is stored.
Drawbacks of programmed and Interrupt-driven I/O
requires active intervention of CPU, transfer rate is limited.
DMA is preferred to move large volume of data
DMA burst mode
transfer a block of data
DMA cycle stealing mode
each byte of data transfer, steals a bus cycle from cpu.
Info sent to DMA modules from CPU
read or write control line, address of I/O involved, starting memory address to read/write
Number of word to be read or written
Five-State Process Model in OS
New,Ready,Running,Exit
Waiting