Documente Academic
Documente Profesional
Documente Cultură
Computer is a fast electronic calculating machine that accepts digitized input information,
processes it according to a list of internally stored instructions, and produces the resulting
output information.
Personal computer:
• The most common computer is the personal computer , which has found wide use
in homes, schools, and business offices.
Desktop computers:
• They have processing and storage units, visual display and audio output units, and
a keyboard that can all be located easily on a home or office desk.
• Portable notebook computers are a compact version of the personal computer with
all of these the dimensions of desktop computers , have significantly more
computational power than personal computers.
• Beyond workstations, a range of large and very powerful computer systems exist
are called enterprise systems and servers at the low end of the range, and
supercomputers at the high end.
• They are used for business data processing in medium to large corporations that
require much more computing power and storage capacity than workstations can
provide.
Servers:
• Serves contain sizable database storage units and are capable of handling large
volumes of requests to access the data.
• In many cases, servers are widely accessible to the education, business, and
personal user communities.
• The requests and responses are usually transported over internet communication
facilities.
• The internet and its associated servers have become a dominant world wide source
of all types of information.
Supercomputers:
• They are used for the large-scale numerical calculations required in applications
such as weather forecastin g and aircraft design and simulation.
MAR MDR
Control
PC R0
R1
Processor
IR
ALU
Rn 1
n general purpose
registers
Figure 1.2. Connections between the processor and the memory.
Figure 1.3. Singlebus structure.
All the functional parts of a computer system must be interconnected in some organized way to
obtain an efficient working system. To obtain higher speeds , parallel transfer of data is essential
For this purpose , all the functional units are connected using a group of ines called bus. A “bus”
is nothing but a group of wires,which carry information from source to destination, in the form of
electrical signal.The simplest scheme is to use single common bus as shown in figure.
Data bus :
The data bus is used to carry data (operand) from input device or memory to the
processor.
Address bus:
The processor uses this bus to access the memory or any I/O device connected to
it.
The processor sends “address” of the device for read or write operation.Hence ,
address is unidirectional.
Control bus:
For synchronizing various activities like read,write,reset, etc.,the processor signals
to inform the devices about any activity. Hence control lines are needed. Hence
control bus is also bidirectional.
The control bus thus is a set of individual signals carrying information at different
instants of time.
Q2.A)Explain the different types of addressing modes with an example for each
Example: - MOV 5, R0 [ R0 5 ]
Direct Addressing Modes: - In this mode, the “Effective Address (EA)” is equal to the address
part of the instruction. The operands reside in memory (main) and its address is given directly by
the address field of the instruction.
Indirect Addressing Mode: -In this mode, the address field of the instruction gives the address
where the effective address is stored in memory. The effective of the operand is the contents of a
register or memory location whose address appears in the instruction.
Example: - MOV A, R0 [ R0 A ]
MOV R0, R1 [ R1 [R0] ]
Register Addressing Mode: It is conceptually same as direct addressing but specifies a register
instead of a memory location. In this mode the operands are in registers that reside within the
CPU. The particular register is selected from a register field in the instruction. A K-bit field can
specify any one 2k register.
Example:
MOV A, R0 [R0 A]
Register indirect Addressing Mode-In this mode the instruction specifies a register in the CPU
whose contents give the address of the operand in the memory. A reference to the register is then
equivalent to specifying a memory address.
Example-
M OV [X], R0 RO [X]
EA= [ PC ] + ADR
Example-
MOV $ADR [ AC [PC] + [ADR] ]
4(a) What are the two different I/O techniques in which CPU is directly involved in data
transfer?
1. Parallel port: Transfers data in the form of a number of bits, typically 8 or 16,
simultaneously to or from the device.
Address
DATAIN Data
Encoder
R/W and Keyboard
Processor SIN
debouncing switches
Master ready circuit
Valid
Input
Sla veready
interf ace
Figure 4.28. Keyboard to processor connection.
When a key is pressed, its switches close and establish a path for an electrical signal.
This signal is detected by an encoder circuit that generates the ASCII code for the
corresponding character.
A difficulty with such push-button switches is that the contacts bounce when a key is
pressed.
The effect of bouncing must be eliminated. For this, a simple debouncing is implemented.
The output of the encoder consists of the bits that represent the encoded character and
one control signal called valid, which indicates that a key is being pressed.
This information is sent to the interface circuit, which contains a data register, DATAIN,
and a status flag, SIN.
When a key is pressed, the valid signal changes from 0 to 1, causing the ASCII code to be
loaded into DATAIN and SIN to be set to 1. The status flag SIN is cleared to 0 when the
processor reads the contents of DATAIN register
D7 Q7 D7
Keyboard
data
D0 Q0 D0
SIN
Status Valid
flag
Sla ve
ready 1
Read
status
Read
data
R/ W
Master
ready
A31
Address
decoder
A1
A0
The output lines of the DATAIN registers are connected to the data lines of the bus by
means of three-state drivers, which are turned on when the processor issues a read
instruction with the address that selects this register
The SIN signal is generated by a status flag circuit. This signal is also sent to the bus
through a three-state driver.
It is connected to bit D0, which means it will appear as bit 0 of the status register. Other
bits of this register do not contain valid information.
An address decoder is used to select the input interface when the high –order 31 bits of an
address corresponds to any of the addresses assigned to this interface.
Address bit A0 determines whether the status or the data registers is o be read when the
master-ready signal is active. The control handshake is accomplished by activating the
slave-ready signal when either read-status or read-data is equal to 1.
OUTPUT INTERFACE
The printer operates under control of the handshake signals offers valid and idle
in a manner similar to the handshake used on the bus with the master-ready and
slave-ready signals.
When it is ready to accept a character, the printer asserts its idle signal. The
interface circuit can then place a new character on the data lines and activate the
valid signal.
Data
Figure 4.31. Printer to processor connection.
The figure below shows an implementation of this interface. Its operation is similar to
the input interface, the only significant difference is the handshake control circuit.
Serial port:
A serial port is used to connect the processor to I/O devices that require transmission of
data one bit at a time.
The key feature of an interface circuit for a serial port is that it is capable of
communicating in a bit serial fashion on the device side and in a bit parallel fashion on
bus side.
Serial
Input shift re gister input
DATAIN
D7
D0
DATAOUT
Myaddress
RS1
RS0 Chip and
register Serial
R /W Output shift re gister output
select
Ready
Accept
Recei ving clock
Status
I NTR and
control
Transmission clock
The part of the interface that deals with the bus is the same as in the parallel
interface described earlier.
The status flags SIN and SOUT serve similar functions. The SIN flag is set to 1
when new data is loaded in DATAIN; it is cleared to 0 when the processor reads
the contents of DATAIN.
As soon as the data are transferred from the input shift register into the DATAIN
register, the shift register can start accepting the next 8 bit character from the I/O
device.
The SOUT flag indicates whether the output buffer is available. It is cleared to 0
when the processor writes new data into the DATAOUT register and set to 1
when data are transferred from DATAOUT into the output shift register.
(b) With the block diagram of a DMA controller, Explain how data is transferred between disk
and memory.
Main
Processor
memory
System b us
Disk/DMA DMA
controller controller Printer Keyboard
Figure 4.19. Use of DMA controllers in a computer system.
A program writes the address and word count information into the registers of the
corresponding channel of the disk controller. It also provides the disk controller with
information to identify the data for future retrieval.
When the DMA transfer is completed, this fact is recorded in the status and control
register of the DMA channel by setting the done bit.
At the same, if the IE bit is set, the controller sends an interrupt request to the processor
and sets the IRQ bit.
Among the 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.
Since the processor originates most memory access cycles, the DMA controller can be
said to “steal” memory cycles from the processor. Hence this interweaving technique is
called “cycle stealing”.
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.
5.a) Show the organization of bits cells in a 16*8 memory chip and explain how read and write
operation are carried out ?
Memory cells are usually organized in the form of an array.
Each cell is capable of storing one bit of information.
Each row of cells constitutes a memory word
All cells of a row are connected to a common line referred to as the word line, which is
driven by the address decoder on the chip.
The cells in each column are connected to a Sense/Write circuit by two bit lines.
The Sense/Write circuits are connected to the data input /output lines of the chip.
During Read operation, these circuits sense (read) the information stored in the cells
selected by a word line and transmit this information to the output data lines
During Write operation, the Sense/Write circuits receive input information and store it in
the cells of the selected word.
This very small memory chip consisting of 16 words of 8 bits each. (16 x 8 organization)
The data input and the data output of each Sense/Write circuit are connected to a single
bidirectional data line that can be connected to the data bus of a computer.
Two control lines, R/W and CS (Chip Select) are provided.
The R/W input specifies the required operation, and the CS input selects a given chip in a
multichip memory system.
It stores 128 bits and requires 14 external connections for address, data and control
lines. And also 2 lines for power supply and ground connections.
The different types of memory units are employed effectively in a computer. The entire
hierarchy of computer memory is shown below diagram. The hierarchy is explained as
following.
Processor Registers: The fastest access is to data held in processor registers. The processor
registers are at the top in terms of the speed of access.
Processor Cache Memory: The next level of hierarchy is relatively small amount of memory that
can be implemented directly on the processor chip. This memory called a processor cache, holds
copies of instructions and data stored in a much larger memory that is provided externally. The
cache memories divided in two levels. A primary cache is always located on the processor chip.
This cache is small because it competes for space on the processor chip, which must implement
many other functions. The primary cache is referred to as level 1 (L1) cache. A larger,
secondary cache is placed between the primary cache and rest of the memory. It is referred to as
level2 (L2) cache. It is implemented using SRAM chips.
Including a primary cache on the processor chip and using a larger, off –chip, secondary cache
is currently the most common way of designing computers.
Main memory: The next level in the hierarchy is called main memory. This rather large memory
is implemented using the dynamic memory components, typically in the form of SIMMs, DIMM,
or RIMMs. The main memory is much larger but significantly slower than the cache memory. In
a typical computer, the access time for the main memory is about ten times longer than the
access time for the L1 cache.
Secondary memory (magnetic Disk): Disk devices provide a huge amount of inexpensive
storage. They are very slow compared to the semiconductor devices used to implement the main
memory. During program execution, the speed of memory access is of utmost importance.
Secondary
cache L2
Main
Memory
1) generate function
2) propagate function
Si=xi+yi+ci
And
Ci+1=xiyi+(xi+yi)ci
* if the generating function is for stage I is equal to 1. Then ci+1=1 indepande of the input carry
ci
C1=G0+P0c0
C2=G1+P1G0+P1P0c0
C3=G2+P2G1+P2P1G0+P2P1P0c0
C4=G3+P3G2+P3P2G1+P3P2P1G0+P3P2P1P0c0.
The carries are implemented in the block labeled carry look ahead logic adder implemented in
this form is called carry look ahead adder
x1512 y1512 x118 y118 x74 y74 x30 y30
c16 4bit adder
c12
4bit adder
c8
4bit adder
c4
4bit adder . c0
G3 I P3 I G2 I P 2I G 1I P 1I G 0I P0 I
Carrylookahead logic
G0 II P 0 II
Figure 6.5. 16bit carrylookahead adder built from 4bit adders (see Figure 6.4 b).
13 1101
6 0110
i.e 1010
0 0 0
0 1 +1
1 0 -1
1 1 0
Then 1 0 1 0 becomes
-1+1-1 0
Booths algorithm is
01101
-1+1-1 0
0000000 00
111100 11*
0001101**
110011***
1110110010
3)if sign bit of A is 1 set q0 to 0 and add M back to A (that is restoring ) other wise set q0 to 1.
A 00000 1110
M 00011
Sub 11101
Resto 11
00001 1 1 00
Sub 11101
set q0 1 1 1 1 0
00001 0 0 01
Sub 11101
Resto 11
00010 0 1 00
Remainder quotient
7(a) Explain with block diagram single bus organization of the data path inside a processor.
A group of lines that serves as connecting path for different devices is called a bus.
In addition to the lines that carry the data, the bus must have lines for address and control
purposes.
The figure below shows the simplest way to interconnect functional units is to use a
single bus.
The bus can be used for only one transfer at a time, only two units can actively use the
bus at any given time.
Bus control lines are used to arbitrate multiple requests for use of the bus. The main
virtue of the single bus structure is its low cost and its flexibility for attaching peripheral
devices.
Figure 1.3. Singlebus structure.
Some electrochemical devices, such as keyboards and printers are relatively slow.
Memory and processor units operate at electronic speeds, making them the fastest parts of
a computer.
Because all these devices must communicate with each other over a bus, an efficient
transfer mechanism that is not constrained by the slow devices and that can be used to
smooth out the difference in timing among processors, memories, and external devices is
necessary.
Buffer registers are included with the devices to hold the information during transfers.
Buffer registers smooth out timing differences among processors, memories and I/O
device during a sequence of data transfers. This allows the processor to switch rapidly
from one device to another, interweaving its processing activity with data transfers
involving several I/O devices.
Ans: The control sequence for the execution of the instruction ADD(R7)R8 are
Step2: The execution start when pc(process control) is set to point to first instruction of the
program
Step5: the data fetched from MDR and transferred to IR(instruction register)
b) CACHE MEMORY
Main memory is slow compare to the speed of processor a special type of memory called
cache memory is designed which reduces the time needed to access the necessary
information.
There are two types of caches
1) A primary cache is always located on the processor chip referred to as level 1(L1)
cache.
2) A larger secondary cache called level 2(L2) cache,is placed between the processor the
processor and main memory.
The effectiveness of the mechanism is based on a property of computer program
called locality of reference.It is manifested in to two types:
Temporal and Spatial.
Temporal means that a recently executed instructions is likely to be executed again.
Spatial means that the instruction in close proximity to a recently used instruction are
likely executed soon.
The operation of cache memory makes use of the property of locality of reerence .the
term block is used to refer to a set of data at contiguous address locations
A simple arrangement for L2 caahe memory is shown when a read request is received
from the processor the contents of a block of memory words are transferred in to
cache from main memory,later when the program references any of the locations in
this block,contents can be read directly from the cache instead of referring to main
memory.
processor
Main
cache memory
Connection of cache memory to processor
The correspondence between main memory blocks and cache blocks is specified by a
mapping function.when a memory word that is not present in cache is referenced the block
containing the block containing the required operands has to be brought in to cache from
main memory if the cache is full ,then the cache control hardware must decide which block
should be removed to create space for the new block.
The decision depends on many factors and the set of rules govering this constitutes
the replacement algorithm.