Computer Orginisaitation Notes (Priyaranjan)
Computer Orginisaitation Notes (Priyaranjan)
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Computer Organization-Input & Output
Organization 1|Page
MODULE-II
Objectives
1. Accessing I/O Devices
2. Interrupts
2.1 Interrupt Hardware
2.2 Enabling & Disabling Interrupts
2.3 Handling Multiple Devices
2.4 Controlling Device Requests
2.5 Exceptions
3. Direct Memory Access
4. Buses
1. Accessing I/O Devices:
A simple arrangement to connect I/O devices to a computer is to use a single bus arrangement.
i) Address Decoder:
Address decoder is connected to the address lines of the bus as shown in the fig:
The function of address decoder is: Address decoder enables the device to recognize its
address when this address appears on the address bus.
ii) Data and Status registers:
• Data register holds the data being transferred to or from the processor.
• Status register holds information necessary for the operation of the I/O device.
• Data and status registers are connected to the data lines, and have unique addresses.
iii) Control Circuits:
The control bus of system bus is connected to control circuit as shown in the fig.
It controls the read write operations with respect to I/O device.
I/O interface circuit coordinates I/O transfers.
iii)Program-controlled I/O:
In program-controlled I/O scheme the processor repeatedly checks a status flag of the I/O
devices to achieve the required synchronization between the processor and an input or
output device.
Disadvantage:
Processor checks the status flag of I/O device, if I/O device not ready for data transfer,
processor enters to wait loop.
During this period, the processor is not performing any useful computation.
There are many situations where other tasks can be performed while waiting for an I/O
device to become ready.
2. Interrupts:
Definition: Interrupt is an event which suspends the execution of one program and begins the
execution of another program.
Interrupt signals and its function:
i) INT(Interrupt):
Interrupt is a hardware signal sent by I/O device when it is become ready to alert the processor.
ii) INTR(Interrupt Request):
At least one of the control lines called interrupt request line is usually dedicated for this purpose.
iii) INTA(Interrupt Acknowledgement):
Interrupt-Acknowledge signal is a special signal issued by the processor to the device that its
request has been recognized so that it may remove its interrupt request signal.
iv) ISR( interrupt-service routine):
The routine executed in response to an interrupt request is called the interrupt-service
routine(interrupt program).
b. Interrupt-service routine may not have anything in common with the program it
interrupts.
c. Interrupt-service routine and the program that it interrupts may belong to different
users.
d. As a result, before branching to the interrupt-service routine, not only the PC, but
other information such as condition code flags, and processor registers used by both
the interrupted program and the interrupt service routine must be stored.
e. This will enable the interrupted program to resume execution upon return from
interrupt service routine.
10) Saving and restoring information can be done automatically by the processor or explicitly
by program instructions.
11) Saving and restoring registers involves memory transfers:
a. Increases the total execution time.
b. Increases the delay between the time an interrupt request is received, and the
start of execution of the interrupt-service routine.
This delay is called interrupt latency.
12) In order to reduce the interrupt latency, most processors save only the minimal amount of
information:
a. This minimal amount of information includes Program Counter and processor
status registers.
13) Any additional information that must be saved , must be saved explicitly by the program
instructions at the beginning of the interrupt service routine.
14) When a processor receives an interrupt-request, it must branch to the interrupt service
routine.
15) It must also inform the device that it has recognized the interrupt request.
This can be accomplished in two ways:
i) Some processors have an explicit interrupt-acknowledge control signal for this purpose.
ii) In other cases, the data transfer that takes place between the device and the processor can
be used to inform the device.
3) Another end of interrupt request line is connected to INTR (Interrupt request) signal of
processor as shown in the figure above.
4) The I/O device is connected to interrupt request line by means of switch as shown in the
fig.
5) INTR is a INTerrupt Request signal which is sent by I/O device to request interrupt, INTR
is active-low signal.
6) Depends on the interrupt switch on and off we can consider two stares:
i) In-Active State
ii) Active State
i)In-Active State:
When all the switches are open the voltage drop on interrupt request line is equal to the
VDD.
Therefore INTR=0
This state is called as in-active state of the interrupt request line.
ii)Active State:
The I/O device interrupts the processor by closing its switch.
7) When switch is closed the voltage drop on the interrupt request line is found to be zero.
Therefore INTR=1
8) The signal on the interrupt request line is logical OR of requests from the several I/O
devices.
Therefore, INTR=INTR1 + INTR2 + ……….+ INTRn
2.2. Enabling and Disabling Interrupts:-
Disadvantages of interrupt:
1) Interrupt-requests interrupt the execution of a program, and may alter the intended
sequence of events:
2) Sometimes such alterations may be undesirable, and must not be allowed.
Example: The processor may not want to be interrupted by the same device (either input or
output device) while executing its interrupt-service routine.
To overcome above disadvantages, Processors generally provide the ability to enable and disable
such interruptions as desired called Interrupt-Enable and Interrupt-Disable
There are 3 techniques to enable and disable the interrupts.
Method 1:
To avoid interruption by the same device during the execution of an interrupt service routine:
First instruction of an interrupt service routine can be Interrupt-disable.
Last instruction of an interrupt service routine can be Interrupt-enable.
Method 2: suitable for a simple processor with only one interrupt-request line:
1) The processor automatically disables interrupts before starting the execution of the
interrupt service routine.
2) Uses the PS (Processor status) register,(1 bit in the PS register called interrupt-enable
indicates whether interrupts enabled),when this bit is 1 interrupt is accepted.
3) After saving the contents of the PC and the processor status register (PS) on the stack, the
processor clears the Interrupt-enable bit in its PS register, thus disabling further interrupts.
4) When return-from-interrupt is executed, the contents of the PS are restored from the stack,
setting the interrupt-enable bit to 1.
Method 3: Uses special INTR line:
1. The device raises an interrupt request.
2. The processor interrupts the program currently being executed.
3. Interrupts are disabled by changing the control bits in the Processor Status register
4. The device is informed that its request has been recognized, and in response, it deactivates the
interrupt-request signal.
5. The action requested by the interrupt is performed by the interrupt-service routine.
6. Interrupts are enabled and execution of the interrupted program is resumed.
2.3 HANDLING MULTIPLE DEVICES:-
1) The information needed to determine whether an input or output device is requesting an
interrupt is available in its status register.
2) When a device raises an interrupt request, it sets IRQ bit to 1, which is in its status register.
Example: Bits KIRQ and DIRQ are the interrupt request bits for the keyboard and the
display, respectively.
3) The simplest way to identify the interrupting device is to have the interrupt service routine
poll all the I/O devices connected to the bus.
4) The first device encountered with its IRQ bit set is the device that should be serviced.
5) An appropriate subroutine is called to provide the requested service.
2.3.1 Polling scheme:
1) Processor uses polling mechanism to poll the status registers of I/O devices to determine
which devices are polled.
2) The first device with status bit is set to 1 is the device whose interrupt request is accepted.
3) The polling scheme is easy to implement.
4) Its main disadvantage in polling scheme is the time spent interrogating the IRQ bits of all
the devices that may not be requesting any service.
12) The processor is in the supervisor mode only when executing operating system routines.
13) It switches from supervisor mode to the user mode before beginning to execute application
programs.
14) Thus, a user program cannot accidentally, or intentionally, change the priority of the
processor and disrupt the system’s operation.
15) An attempt to execute a privileged instruction while in the user mode leads to a special
type of interrupt called a privileged instruction.
b)Multiple-Priority Scheme:
1) A multiple-priority scheme can be implemented easily by using separate interrupt-request
and interrupt-acknowledge lines for each device, as shown in figure.
INTR 1 I N TR p
INTA1 INTAp
Priority arbitration
Fig: Implementation of interrupt priority using individual interrupt-request and acknowledge lines.
Device Device
INTA1
Processor
IN T R p
Device Device
INTA p
Priority arbitration
circuit
Trace:
1) When a processor is operating in the trace mode, an exception occurs after
execution of every instruction, using the debugging program as the exception-
service routine.
2) The debugging program enables the user to examine the contents of registers,
memory locations, and so on.
3) On return from the debugging program, the next instruction in the program
being debugged is executed, and then the debugging program is activated again.
4) The trace exception is disabled during the execution of the debugging program.
Breakpoint:
1) Breakpoint provides a similar facility, except that the program being debugged is
interrupted only at specific points selected by the user.
2) An instruction called Trap or Software-interrupt is usually provided for this
purpose.
3) Execution of this instruction results in exactly the same actions as when a hardware
interrupt request is received.
Working of debugging program:
1) While debugging a program, the user may wish to interrupt program execution after
instruction i.
2) The debugging routine saves instruction i+1 and replaces it with a software interrupt
instruction.
3) When the program is executed and reaches that point, it is interrupted and the debugging
routine is activated.
4) This gives the user a chance to examine memory and register contents.
5) When the user is ready to continue executing the program being debugged, the debugging
routine restores the saved instruction that was a location i+1 and executes a Return-from-
interrupt instruction.
iii)Privilege Exception:-
To protect the operating system of a computer from being corrupted by user programs, certain
instructions can be executed only while the processor is in supervisor mode. These are called
privileged instructions.
Example:
when the processor is running in the user mode, it will not execute an instruction
that changes the priority level of the processor or that enables a user program to
access areas in the computer memory that have been allocated to other users.
An attempt to execute such an instruction will produce privilege exceptions,
causing the processor to switch to the supervisor mode and begin executing an
appropriate routine in the operating system.
Direct Memory Access
Definition for DMA: “A special control unit used to provided to transfer a block of data with high
speed directly between an I/O device and the main memory, without continuous intervention by
the processor, this approach is called direct memory acces(DMA)”
Ex: Internal memory (RAM) data transfers and disk transfers uses DMA.
3.1)Direct Memory Access (DMA):
1) Control unit which performs DMA transfers is a part of the I/O device’s interface circuit.
This control unit is called as a DMA controller.
2) DMA controller performs functions that would be normally carried out by the processor:
For each word, it provides the memory address and all the control signals.
To transfer a block of data, it increments the memory addresses and keeps track of the
number of transfers.
3) DMA controller can transfer a block of data from an external device to the processor,
without any intervention from the processor.
4) However, the operation of the DMA controller must be under the control of any program
executed by the processor. That is, the processor must initiate the DMA transfer.
5) To initiate the DMA transfer, the processor informs the DMA controller of:
Starting address
Number of words in the block.
Direction of transfer (I/O device to the memory, or memory to the I/O device).
6) After initiating the DMA transfer, the processor suspends the program that initiated the
transfer, and continues with the execution of some other program.
The program whose execution is suspended is said to be in the blocked state.
7) On receiving this information, the DMA controller proceeds to perform the requested
operation.
8) Once the DMA controller completes the DMA transfer, it informs the processor by raising
an interrupt signal.
9) While a DMA transfer is taking place, the program that requested the transfer cannot
continue, and the processor can be used to execute another program.
10) After the DMA transfer is completed, the processor can return to the program that requested
the transfer.
DMA with OS:
11) I/O operations are always performed by the operating system of the computer in response
to a request from an application program.
12) The OS is also responsible for suspending the execution of one program and starting
another.
13) Thus, for an I/O operation involving DMA, the OS puts the program that requested the
1transfer in the Blocked state, initiates the DMA operation, and starts the execution of
another program.
14) When the transfer is completed, the DMA controller informs the processor by sending an
interrupt request
15) In response, the OS puts the suspended program in the Runnable state so that it can be
selected by the scheduler to continue execution.
i) Registers of DMA:
1) Figure shows an example of the DMA controller three registers that are accessed by the
processor to initiate transfer operations.
2) Two registers are used for storing the Starting address and the word count.
That is, it transfers data from the I/O device to the memory.
b) DONE flag register:
This information is informed to CPU by means of DONE bit.
When done flag=1 then DMA controller is ready to receive another command
When done flag=0 then DMA controller is not ready to receive another command
Main
Processor memory
System bus
1) cycle stealing
2) Burst mode
1) Cycle stealing:
1) Memory accesses by the processor and the DMA controller are interwoven.
2) Requests by DMA devices for using the bus are always given higher priority than processor
requests.
3) Among different DMA devices, top priority is given to high-speed peripherals such as a
disk, a high-speed network interface, or a graphics display device.
4) Since the processor originates most memory access cycles, the DMA controller can be said
to “steal” memory cycles from the processor.
5) Hence, the interweaving technique is usually called cycle stealing.
2) Burst mode:
1) In this mode,the DMA controller may be given exclusive access to the main memory to
transfer a block of data without interruption. This is known as block or burst mode.
2) Most DMA controllers incorporate a data storage buffer. In the case of the network
interface
Example: the DMA controller reads a block of data from the main memory and stores it
into its input buffer. This transfer takes place using burst mode at a speed appropriate to
the memory and the computer bus.
3) Then, the data in the buffer are transmitted over the network at the speed of the network.
Conflicts in DMA:
A conflict may arise if both the processor and a DMA controller or two DMA controllers
try to use the bus at the same time to access the main memory.
To resolve these conflicts, an arbitration procedure is implemented on the bus to coordinate
the activities of all devices requesting memory transfers.
3.2 Bus Arbitration:-
Processor and DMA controllers both need to initiate data transfers on the bus and access
main memory.
The device that is allowed to initiate transfers on the bus at any given time is called the bus
master.
When the current bus master relinquishes its status as the bus master, another device can
acquire this status.
Bus Arbitration: The process by which the next device to become the bus master is
selected and bus mastership is transferred to it is called bus arbitration.
Purpose of Bus Arbitration:
Bus arbitration is required to resolve the conflict that arises when both the Processor and a
DMA controller or two DMA controllers try to use the bus at same time to access main
memory.
Bus arbitration is required coordinate the activities of all devices requesting memory transfers.
There are two approaches to bus arbitration:
i) Centralized arbitration: a single bus arbiter performs the required arbitration.
ii) Distributed arbitration: all devices participate in the selection of the next bus master.
i)Centralized Arbitration:-
1) In centralized arbitration, the bus master may be the processor or a separate unit connected to
the bus.
2) Figure shows a basic arrangement in which processor contains the bus arbitration circuit.
BBSY
BR
Processor
DMA DMA
controller controller
BG1 1 BG2 2
3) In this case, the processor is normally the bus master unless it grants bus mastership to one of
the DMA controllers.
4) A DMA controller indicates that it needs to become the bus master by activating the BUS
request line, BR.
5) This signal is connected to all DMA controllers using a DAISY-CHAIN arrangement.
6) When the bus request line is activated, the processor activates the bus grant signal, BG1
indicating to the DMA controllers that they may use the bus when it becomes free.
7) This signal is connected to all DMA controllers using a DAISY-CHAIN arrangement.
8) Thus, if DMA controller 1 is requesting the bus, it blocks the propagation of the grant signal
to the other devices; otherwise, it passes the grant signal to next device.
9) The current bus master indicates to all devices that it is using bus by activating another line
called BUS-BUSY (BBSY).
10) Hence, after receiving the BUS –grant signal, a DMA controller waits for BUS-BUSY to
become inactive, then it gets the BUS Mastership. at this time it activates BUS-BUSY.
11) The timing diagram in the figure shows the sequence of events for the devices.
DMA controller 2
Time
asserts the BR signal. Processor asserts
BR
the BG1 signal
BG1
BG1 signal propagates
BG2 to DMA#2.
BBSY
Bus
master Processor DMA controller 2 Processor
Distributed Arbitration:
1) In distributed arbitration all devices participate in the selection of next bus master.
4) When one or more devices request the bus, they assert the start arbitration signal and place
their 4-bit identification numbers on four lines, ARB0 through ARb3.
5) A winner is selected as a result of the interaction among the signals transmitted over these lines
by all contenders.
6) If one device puts 1 on the bus and another device puts 0 on the same bus line, the bus line
status will be 0.
Example:
1) Consider that two devices A and B having ID numbers 5 and 6 respectively are requesting the
use of bus.
2) Device A transmits the pattern 0101, and device B transmits the pattern 0110.
3) The code seen by both devices is 0111.
4) If it detects a difference at any bit position, it disables its drivers at that bit position and for all
lower-order bits. It does so by placing 0 at the input of these drivers.
5) In our example device A detects the difference on the line ARB1; hence it disables its drivers
on lines ARB1 and ARB0. This causes the pattern on the arbitration lines to change to 0110,
which means that device B has won the contention.
MODULE-II
I/O Operations(part2)
4.1 Interface Circuits
An I/O interface consists of the circuitry required to connect an I/O device to a computer bus.
On one side of the interface, we have bus signals. On the other side, we have a data path with its
associated controls to transfer data between the interface and the I/O device – port. We have two
types:
A parallel port transfers data in the form of a number of bits (8 or 16) simultaneously to or
from the device. A serial port transmits and receives data one bit at a time. Communication with
the bus is the same for both formats. The conversion from the parallel to the serial format, and
vice versa, takes place inside the interface circuit. In parallel port, the connection between the
device and the computer uses a multiple-pin connector and a cable with as many wires. This
arrangement is suitable for devices that are physically close to the computer. In serial port, it is
much more convenient and cost-effective where longer cables are needed.
i)Parallel Port
The hardware components needed for connecting a keyboard to a processor Consider the
circuit of input interface which encompasses (as shown in below figure):
– Status flag, SIN
– R/~W
– Master-ready
– Address decoder
A detailed figure showing the input interface circuit is presented in figure 4.29. Now, consider
the circuit for the status flag (figure 4.30). An edge-triggered D flip-flop is used along with read-
data and master-ready signals.
2
The hardware components needed for connecting a printer to a processor are: the circuit
of output interface, and
– Slave-ready
– R/~W
– Master-ready
– Address decoder
– Handshake control
The input and output interfaces can be combined into a single interface. The general purpose
parallel interface circuit that can be configured in a variety of ways. For increased flexibility, the
circuit makes it possible for some lines to serve as inputs and some lines to serve as outputs,
under program control.
ii)Serial port
A serial interface circuit involves – Chip and register select, Status and control, Output
shift register, DATAOUT, DATAIN, Input shift register and Serial input/output – as shown in
figure 4.37.
3
Consider a computer system using different interface standards. Let us look in to Processor bus
and Peripheral Component Interconnect (PCI) bus. These two buses are interconnected by a
circuit called bridge. It is a bridge between processor bus and PCI bus. An example of a
computer system using different interface standards is shown in figure 4.38. The three major
standard I/O interfaces discussed here are:
The topics discussed under PCI are: Data Transfer, Use of a PCI bus in a computer system, A
read operation on the PCI bus, Device configuration and Other electrical characteristics. Use of a
PCI bus in a computer system is shown in figure 4.39 as a representation.
Host, main memory and PCI bridge are connected to disk, printer and Ethernet interface
through PCI bus. At any given time, one device is the bus master. It has the right to initiate data
transfers by issuing read and write commands. A master is called an initiator in PCI terminology.
This is either processor or DMA controller. The addressed device that responds to read and write
commands is called a target. A complete transfer operation on the bus, involving an address and
a burst of data, is called a transaction. Device configuration is also discussed.
• The target controller sends a command to the disk drive to move the read head to the first
sector involved in the requested read operation.
• The target transfers the contents of the data buffer to the initiator and then suspends the
connection again.
4
• The target controller sends a command to the disk drive to perform another seek
operation.
• As the initiator controller receives the data, it stores them into the main memory using the
DMA approach.
• The SCSI controller sends an interrupt to the processor to inform it that the requested
operation has been completed.
The bus signals, arbitration, selection, information transfer and reselection are the topics
discussed in addition to the above.
• Accommodate a wide range of data transfer characteristics for I/O devices, including
telephone and Internet connections
• Enhance user convenience through a “plug-and-play” mode of operation
a)Port Limitation:
Here to add new ports, a user must open the computer box to gain access to the internal
expansion bus and install a new interface card. The user may also need to know how to configure
the device and the software. And also it is to make it possible to add many devices to a computer
system at any time, without opening the computer box.
b)Device Characteristics:
The kinds of devices that may be connected to a computer cover a wide range of functionality -
speed, volume and timing constraints. A variety of simple devices attached to a computer
generate data in different asynchronous mode. A signal must be sampled quickly enough to track
its highest-frequency components.
c)Plug-and-play:
Whenever a device is introduced, do not turn the computer off/restart to connect/disconnect a
device. The system should detect the existence of this new device automatically, identify the
appropriate device-driver software and any other facilities needed to service that device, and
establish the appropriate addresses and logical connections to enable them to communicate.
ii)USB architecture
To accommodate a large number of devices that can be added or removed at any time, the
USB has the tree structure. Each node has a device called a hub. Root hub, functions, split bus
operations – high speed (HS) and Full/Low speed (F/LS).
4.8 Concluding remarks
The three basic approaches of I/O transfers are discussed. The simplest technique is
programmed I/O, in which the processor performs all the necessary control functions under
direct control of program instructions. The second approach is based on the use of interrupts. The
third I/O scheme involves DMA, the DMA controller transfers data between an I/O device and
the main memory without continuous processor intervention. Access to memory is shared
between the DMAQ controller and the processor.
5
Three popular interconnection standards – PCI, SCSI, USB are discussed. They represent
different approaches that meet the needs of various devices and reflect the increasing importance
of plug-and-ply features that increase user convenience.
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Computer Organization-Memory Unit 1|Page
Non-volatile memory
Both S-RAM and D-RAM are volatile so ROMs are used to store the information
permanently.
Different Type of ROMs are: ROM, PROM, EPROM and EEPROM.
Read-only memory (ROM) is an integrated circuit programmed with specific data when
it is manufactured.
Word line
P Connected to store a 0
Bit line
PROM chips contain a fuse at the switch P so all bits contain binary 0. While writing user
will pass current to burn out the fuse where ever required to store binary 1. This process
is known as burning the PROM.
Flash memory
Flash memory is a type of EEPROM it has in-built circuit to erase by applying an electrical
field to the entire chip or blocks.
Flash memory works much faster than traditional EEPROMs because it writes data in
chunks, usually 512 bytes in size, instead of 1 byte at a time.
Flash memories are implemented as Flash cards, removable solid-state storage devices
(SSD) and flash drives.
Virtual Memory
The main memory of a computer ranges from 100MB to 8GB, if some program of
larger size than the size of main memory need to be executed then entire program
is stored in secondary storage devices (HDD) and only those part/block of the
program which is currently needed for execution by the processor is placed in the
main memory.
When a new block or next part of the program is needed by the processor the
existing block is moved back to HDD and the new block is brought into main
memory.
Operating system is responsible for moving the program blocks between main
memory and HDD this technique is called as Virtual Memory.
The binary address given by the processor is called virtual address.
The MMU (Memory Management Unit) translates virtual address to physical
address and search the data in cache memory /main memory if present will be
accessed, if not found then data transfer is done from HDD through DMA (Direct
Memory Access).
Processor
MMU
Cache
Main Memory
Disk Storage
Address Translation
All programs & data in the disk storage is divided into fixed length units called
page, page size range from 2KB to 16KB.
The processor generates the virtual address requesting for instructions or data.
Virtual address consists of virtual page number (higher order bits) followed by
offset (lower order bits) offset specify the location of the word in each page.
The allocated memory for a process is divided number of blocks (page frames)
such that page size =page frame size.
Information about which page is residing in which page frame is kept in page
table.
The starting address of the page table is kept in a page table register.
Virtual page number + page table base register=page frame address
The page table is frequently accessed by MMU so ideally it should be stored in
MMU as the size of page table is large it is kept in main memory so as to reduce
the time for accessing a small portion of the page table is placed on the buffer on
MMU called as Translation Look-ahead Buffer( TLB).
Address Translation proceeds as follows:
Processor gives virtual address- MMU looks in TLB if entry is found returns the
physical address of the page. If the page entry is not found in TLB then the page
table on main memory is searched and the physical address of the page is returned
if found.
If the requested page is not in main memory it is a page fault then MMU requests
OS to bring the required page from HDD.
OS will suspend the execution of the current process until the desired page is
brought.
If the desired page is brought from HDD and main memory is full then an existing
page has to be replaced, so least recently used pages is chosen for replacement
The number of bytes per sector is fixed for a given disk drive, varying in size from
512 bytes to 2KB. All tracks with the same number, but as different surfaces, form
a cylinder.
The information is recorded on the disk surface 1 bit at a time by magnetizing a
small area on the track with the write head. That bit is detected by sending the
direction of that magnetization as the magnetized area passes under the read head.
The 12 bytes of ECC (Error Correcting Code) information are used to detect and
correct errors in the 512 byte data field.
The operating system specifies the track, sector and surface of the desired block.
The disk controller translates that requests to a series of low level disk operations.
Seek time: - Is the average time required to move the read/write head to the
desired track.
Access time: - Is the time required to move the head from one track to adjoining
one.
Rotational latency: - Is the average time required for the needed sector to pass
under head once and head has been positioned once at the correct track.
Average Access time: - Is equal to seek time plus rotational latency.
Burst rate: - Is the maximum rate at which the drive produces or accepts data once
the head reaches the desired sector,
Optical Disks
Compact Disk (CD) Technology:- CD system is based on laser light source. A laser beam
is directed onto the surface of the spinning disk. Physical indentations in the surface are
arranged along the tracks of the disk. They reflect the focused beam towards a photo
detector, which detects the stored binary patterns.
Implementation:
The controller for a microwave oven can be implemented by a small microprocessor
based computer unit.
The computational tasks include:
Maintain time of day clock
Determining the actions needed in the various cooking options
Control signals generation to turn on or off magnetron and fan
Displaying information.
The program for controlling oven must be stored in a ROM
Oven also need RAM to store user specified data & computation
A simple processor with small ROM and RAM units and parallel I/O on a single VLSI
chip is sufficient to implement the controller of oven in a cost effective way.
Each sensor generates a charge that corresponds to one pixel, number of pixels
determines the quality of picture.
The charge is an analog which is converted into a digital using A/D conversion
circuits.
In digital image the color and intensity of each pixel is represented by a number of
bits.
The camera controller contains a processor, memory (both RAM and EEPROM), and
set of interface circuits to connect to other parts of the system.
The processor obtain raw image from the A/D circuits and generate images in
standard formats such as TIFF, JPEG etc.
A captured image can be displayed on LCD screen in the camera and are stored in a
larger flash storages.
PCI or USB interfaces are used to transfer the images to a computer or a printer.
The camera controller generates signals to control the operation of the motor and the
flash unit.
A digital camera requires more powerful processor with less power consumption to
perform complex signal processing functions.
Figure 9.4 shows the block diagram of simple microcontroller which contains:
Processor core
on-chip memory
processor bus connections on the chip to connect to external memory
two 8-bit parallel interfaces, called A and B
one serial interface
32-bit counter/timer circuit to generate internal interrupts and serve as a
system stop
watch
PARALLEL I/O PORTS
A and B ports can be used as either inputs or outputs Figure 9.5 illustrates the
bidirectional control for one bit in Port A.
Port pin PAi is treated as an input if the data direction flip-flop contains 0. In this case
Read_port signal is placed on port and data onto the data line Di of the processor bus
and processor reads the data on the pins.
The port pin PAi serves as an output if the data direction flip-flop is set to 1. In this
case, the data is loaded into the data output flip-flop and Write Port signal, is placed
on the pin.
Figure 9.6 shows the eight 8-bit registers used for data transfer operations on ports A
and B and addresses assigned to these registers.
Counter Mode
The counter mode is selected by setting CTCON7 to 0.The starting value is loaded into
the counter by writing it into register CNTM.
The counting process begins when bit CTCON0 is set to 1 by a program instruction
then the CTCON0 bit is cleared to 0.
The counter is decremented by pulses on the Counter_in line. Upon reaching 0, the
counter circuit sets the status flag CTSTAT0 to 1, and will raise an interrupt.
The counting process is stopped by setting CTCON1 to 1.
Timer Mode
The timer mode is selected by setting CTCON7 to 1. This mode is suitable for
generating a square-wave signal on the output line Timer_out.
The counting process begins when bit CTCON0 is set to 1 by a program instruction
then the CTCON0 bit is cleared to 0.
As the counter counts down, the value on the output line is held constant. Upon
reaching zero, the counter is reloaded automatically with the starting value, and the
output signal on the line is inverted.
INTERRUPT CONTROL MECHANISM
The microcontroller has two interrupt request lines, IRQ and XRQ. The IRQ for I/O
interfaces within the microcontroller and XRQ for interrupts raised by external
devices.
When IRQ line is active the processor polls to determine the sourceof the interrupt
request by examining PSTAT, SSTAT and CTSTAT.
PSR, has two bits for enabling interrupts. The IRQ interrupts are enabled if PSR6 = 1,
and the XRQ interrupts are enabled if PSR7 = 1.
A vectored interrupt scheme is used, with the vectors for IRQ and XRQ each vector
contains the address of the corresponding interrupt service routine.
During interrupt request in addition to saving the return address in LR, the contents of
the processor status register, PSR, are saved in a processor register IPSR.
Module-3
1. Explain internal organization of 16 Megabit DRAM chip configured as 2M*8 cells
Also explain how it can be made to work fast in fast page mode.
2. Explain the working of 16-megabyteDRAM chip configured as 1M x 16 memory
chip.
3. Discuss the internal organization of a 1K x 1 memory chip
4. Explain the read and write operations of a static RAM cell and CMOS cell
5. Differentiate between SRAM and DRAM giving 5 key differences.(With a cell
diagram).
6. With a block diagram, explain the organization of 8M x 32 memory using 512 K x 8
memory chips
7. Explain synchronous DRAM with a neat diagram.
8. With figure analyse the memory hierarchy in terms of speed cost and size
9. What is cache? With block diagram explain Direct, Associative and set-associative
mapping between cache and main memory.
10. Briefly explain any four non-volatile memory concepts(ROM, PROM, EPROM,
EEPROM, Flash)
11. Discuss in detail any one feature of memory design that leads to improved
performance of computer. (memory Interleaving, Cache hit and miss)
12. Calculate the average access time experienced by a processor if cache hit rate is 0.88.
miss-penalty is 0.015 milliseconds and cache access time is 10 microseconds.
13. Write short notes on Hard disk/ Magnetic Disk, CD/DVD, Magnetic Tapes.
14. What is virtual memory? Explain simple method of translating virtual address into
physical address.
15. Define the following:
a. Memory Latency
b. Memory bandwidth
c. Hit rate
d. Miss-penalty
e. Memory access time
f. Memory cycle time
g. Random access memory
h. Static memories
i. Seek time
j. Latency
k. Access time
Module- 4
1. Design 4 bit carry look ahead logic and explain how it is faster them 4 bit ripple
adder. Also explain addition/subtraction Logic unit.
2. Explain with figure the design and working of a 16-bit carry look ahead adder built
from 4-bit adder. ( FAST ADDERS)
3. Explain booths algorithm apply booths algorithm to multiply signed numbers +13 and
-6.
4. Write the circuit diagram and algorithms for restoring and non-restoring division
methods.
5. Perform division of 8 by 3 using non restoring division method.
6. Perform division of 16 by 4 using restoring division method
7. Explain and Multiply (+14) and ( -6) using Bit-Pair Recording Method
8. List out the rules for addition, subtraction, multiplication and division of floating
point numbers. Explain with circuit diagram
9. Explain IEEE standard for Floating point numbers.
OR
Explain normalization, excess - exponent and special values with respect to IEEE
floating point representation.
Module-5
1. Draw and explain the single bus organization of the data path inside a processor
2. Explain the control sequence for execution of
1) Add (R3) R1
2) Mul R1, (R2)
3) Add #6, r1
4) an unconditional branch instruction
3. Explain with block diagram the basic organization of a micro programmed control
unit to support conditional branching in the micro program.
4. Write the control sequence for the instruction Add R1, R2, R3 with a neat diagram
using Three bus organization (Multiple Bus Organization).
5. Explain with a neat diagram micro-programmed control method for design of control
unit using micro-instructions.
6. With a neat diagram explain hardwired control unit show the generation Zin and End
control signals
7. With a neat diagram explain complete processor.
8. Briefly explain the Diagram of camera and Microwave Oven. Define Embedded
System.
9. Explain the organization of a simple microcontroller and discuss some features that
may be used in practice.
10. Explain the structure of general purpose multiprocessor in detail.