DECO Final Answer Key
DECO Final Answer Key
UNIT I-
NUMBER SYSTEM
Short Questions
1. a)Convert (i)(11101001110)2=()8
ANS:- (11101001110)2= (1646) 8
(iii)(235)10 = ( )16
b) Show how to connect NAND gates to get an AND gate and OR gate?
2. a) write the decimal number 5 in the weighted code form of
i) 8 4 2 1
ii) 5 2 1 1
iii) 8 4 -2 -1
b) Express the function Y=A+B’C in canonical SOP and canonical POS form
3. Evaluate the following Boolean expression using Boolean Algebra and draw the
logic diagram.
(a)F(X, Y, Z) = (X +Y )(X’(Z’+Y’))’+X’Y’+X’Z’.
(b) F(A,B,C,D)=AB’C+B+BD’+ABD’+AC’
4. (a) Explain about Boolean postulates and laws.
(b) construct the hamming code for BCD 0110.using even parity.
b) Explain various logic gates with truth table and logic diagram
6 a) perform following binary numbers using 2’s complement
i) 39-22 ii)-47+22
a) ((AB’+ABC)’+A(B+AB’))’
b) AB+A’C+AB’C(AB+C)
UNIT-II
COMBINATIONAL CIRCUITS
Short Questions
Long Questions
f(A,B,C,D)=∑m(0,2,3,4,5,8,10,11,13,14,15).
b) define magnitude comparator? draw the block diagram and truth table of 4 bit
magnitude comparator.
4 a) what is full subtractor? draw the block diagram and truth table of full subtractor and
obtain design equation using two half subtractors..
(b) What is a priority encoder? Design a 4 x2 priority encoder with appropriate gates.
f(A,B,C,D)=∑m(6,7,8,9)+d(10,11,12,13,14,15)
UNIT III
SEQUENTIAL CITRCUITS
Short Questions
1. Write a short notes on sequential circuit.
ANS:- A sequential circuit refers to a special type of circuit. It consists of a series
of various inputs and outputs. Here, the outputs depend on a combination of both the
present inputs as well as the previous outputs. This previous output gets treated in the
form of the present state. The sequential circuits can be event driven, clock driven and
pulse driven.
*Flip-flop is a bistable device i.e., it has |*Latch is also a bistable device whose
two stable states that are represented as 0 | states are also represented as 0 and 1.
and 1.
ANS:-
ANS:-
Long Questions
1 a) Distinguish between combinational circuits and sequential circuits.
Ans:- Difference between Combinational and Sequential Circuit
The following table highlights how a combinational circuit is different from a sequential circuit −
Since output does not depend on the time The output relies on its previous
instant, no feedback is required for its feedback so output of previous input is
Feedback
next output generation. being transferred as feedback used
with input for next output generation.
Combinational circuits are mainly used for Sequential circuits are mainly used for
Operation
arithmetic as well as Boolean operations. storing data.
b) With a neat diagram explain operation of SR flip flop and derive its truth table, excitation table
and characteristic equation.
ANS:-
Logic Circuit-
The logic circuit for SR Flip Flop constructed using NOR latch is as shown below-
2. Construction of SR Flip Flop By Using NAND Latch-
Logic Circuit-
The logic circuit for SR Flip Flop constructed using NAND latch is as shown below-
Logic Symbol-
Qn Qn+1
S R States and Conditions
(Present State) (Next State)
Truth Table
Characteristic Equation-
Qn+1 = S + QnR’
Excitation Table-
The excitation table of any flip flop is drawn using its truth table.
Qn Qn+1 S R
0 0 0 X
0 1 1 0
1 0 0 1
1 1 X 0
Excitation Table
ANS:-
Ans:-
S R Q Q
0 0 Latched
0 1 0 1
1 0 1 0
1 1 Metastable
When the device is powered up, a similar condition occurs, because both outputs, Q and Q, are low.
Again, the device will quickly exit the metastable state due to differences between the two gates, but
it's impossible to predict which of Q and Q will end up high. To avoid spurious actions, you should
always set SR flip-flops to a known initial state before using them - you must not assume that they
will initialise to a low state.
A Gated SR latch made from two NOR and two AND gates.
In some situations it may be desirable to dictate when the latch can and cannot latch. The gated SR
latch is a simple extension of the SR latch which provides an Enable line which must be driven high
before data can be latched. Even though a control line is now required, the SR latch is not
synchronous, because the inputs can change the output if the enable line is held high at length.
(Note: If a clock is supplied to the control line, the gated SR latch becomes known as an SR flip
flop because the output changes only when edge-triggered by the clock.[1])
When the Enable input is low, then the outputs from the AND gates must also be low, thus
the Q and Q outputs remain latched to the previous data. Only when the enable input is high can the
state of the latch change, as shown in the truth table. When the enable line is asserted, a gated SR
latch is identical in operation to an SR latch.
The Enable line is sometimes a clock signal, but is usually a read or write strobe.
Enable S R Q Q
0 0 0 Latched
0 0 1 Latched
0 1 0 Latched
0 1 1 Latched
1 0 0 Latched
1 0 1 0 1
1 1 0 1 0
1 1 1 Metastable
3 a)obtain characteristic table and truth table and excitation table of T &D flip flop.
Ans:-
:- D Flipflop
Truth Table
D Q(t+1)
0 0
1 1
Characteristic Equation
Q(t+1) = D(t)
Excitation Table
Q(t) Q(t+1) D
0 0 0
0 1 1
1 0 0
1 1 1
T Flipflop
Truth Table
T Q(t+1)
0 Q(t)
1 Q'(t)
Characteristic Equation
Excitation Table
Q(t) Q(t+1) T
0 0 0
0 1 1
1 0 1
1 1 0
b) convert a SR flip flop into JK flip flop using standard procedure
asn:-
J K QN QN+1
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 0
QN QN+1 S R
0 0 0 X
0 1 1 0
1 0 0 1
1 1 X 0
The conversion table, which is a combination of truth table and excitation table, to implement
a JK flip-flop from SR flip-flop is as follows
J K QN QN+1 S R
0 0 0 0 0 X
0 0 1 1 X 0
0 1 0 0 0 X
0 1 1 0 0 1
1 0 0 1 1 0
1 0 1 1 X 0
1 1 0 1 1 0
1 1 1 0 0 1
Step 4: Find the Boolean expressions for the inputs of the given flip-flop.
Therefore, write the Boolean expressions for S and R from the conversion table using K-Maps.
K-Map for S:
Expression for S would be
S = JQN/
K-Map for R:
R = KQN
ANS:-
JK Flip Flop- JK flip flop is a refined & improved version of SR Flip Flop that has been
introduced to solve the problem of indeterminate state that occurs in SR flip flop when both the
inputs are 1.
In JK flip flop,
Input J behaves like input S of SR flip flop which was meant to set the flip flop.
Input K behaves like input R of SR flip flop which was meant to reset the flip flop.
Logic Circuit-
The logic circuit for JK Flip Flop constructed using SR Flip Flop constructed from NOR latch is
as shown below-
Logic Symbol-
Truth Table-
Truth Table
Qn Qn+1
J K States and Conditions
(Present State) (Next State)
Characteristic Equation-
From here-
Qn+1 = Q’n (JK + JK’) + Qn (J’K’ + JK’)
Excitation Table-
The excitation table of any flip flop is drawn using its truth table.
Qn Qn+1 S R
0 0 0 X
0 1 1 X
1 0 X 1
1 1 X 0
Excitation Table
T QN QN+1
0 0 0
0 1 1
1 0 1
1 1 0
0 0 0
0 1 1
1 0 0
1 1 1
The conversion table, which is a combination of truth table and excitation table, to implement a T flip-
flop from D flip-flop is as follows
T QN QN+1 D
0 0 0 0
0 1 1 1
1 0 1 1
1 1 0 0
Step 4: Find the Boolean expressions for the inputs of the given flip-flop
Therefore, write the Boolean expression for D from the conversion table using K-Map.
K-Map for D:
For this, connect the input D of the given flip-flop (D flip-flop) to the circuit made for the expression of
D obtained from the K Map. Therefore, the circuit would be:
ANS:-
SR flip flop
The excitation table of the SR flip-flop can be constructed from the information available in the
truth table. In the diagram shown below, the first table shows the truth table, from which the
excitation table is derived.
From the truth table, you can observe that when the present state is Qn = 0, the next state
becomes Qn+1 = 0 for two input values S = 0, R = 0 and S = 0, R = 1. (It is shown in the first and
third rows with yellow color)
From this we can say that, for the state transition from Qn = 0 to Qn+1 = 0, the excitation inputs
required are S = 0 and R = 0 or 1. It is filled in the first row(Yellow color) of the excitation table.
Since R has two values(0 and 1), it is denoted as a don’t care condition(x).
Similarly, when you observe the truth table, to obtain the next state output Qn+1 = 1 from the
present state input Qn = 0, the required SR inputs are S = 1 and R = 0(shown in the 5th row as
pink color).
Thus for state transition from 0 to 1, the excitation inputs require are S = 1 and R = 0. It is filled
in the second row of the excitation table.
The state transition from the present state Qn = 1 to the next state Qn+1 = 0 happens only when
the inputs are S = 0 and R = 1(observed from the 4th row in light green color). It is filled in the
third row of the excitation table.
In the same way, the state transition from Qn = 1 to Qn+1 = 1 happens at S = 0, R = 0 and S = 1, R
= 0(shown in second and sixth row of the truth table).
It is filled in the fourth row of the excitation table as Qn = 1, Qn+1 = 1 and S = x, R = 0. Here x
denotes the don’t care condition, as it has two values(0 and 1).
For the JK flip flop, the excitation table is derived in the same way. From the truth table, for the
present state and next state values Qn = 0 and Qn+1 = 0(indicated in the first and third row with
yellow color), the inputs are J = 0 and K = 0 or 1.
Thus the state transition from Qn = 0 to Qn+1 = 0 takes place when J = 0, K = x. It is filled in the
first row of the excitation table.
The state transition from present state Qn = 0 to the next state Qn+1 = 1 occur, when the inputs
are either J = 1, K = 0 or J = 1, K = 1(indicated in the fifth and seventh row with pink color).
Thus the excitation table is filled with datas Qn = 0, Qn+1 = 1, J = 1 and K = x.
Similarly, for the transition of the state from 1 to 0, the inputs are J = 0, K = 1 or J = 1, K =
1(indicated in the fourth and eighth row with ash color). So for this transition, the required
inputs are J = x and K =1, as the value of J can be either 0 or 1.
For the state transition from Qn = 1 to Qn+1 = 1, the J input can be 0 or 1 but the K input remains
at o(indicated in the second and sixth row with violet color). For this transition to occur, the
excitation inputs are J = x and K = 0.
D flip flop
The excitation table of the D flip-flop is derived from its truth table. The excitation table is
constructed in the same way as explained for the SR flip-flop.
Here, when you observe from the truth table shown below, the next state output is equal to the D
input. So it is very simple to construct the excitation table.
For the state transition from Qn = 0 to Qn+1 = 0, the required excitation input is D = 0, regardless
of Qn value. For transition of states from Qn = 0 to Qn+1 = 1, the input required to excite is D = 1.
The state transit from Qn = 1 to Qn+1 = 0 for the input D = 0. For the input D = 1, the state
transition takes place from Qn = 1 to Qn+1 = 1.
All the above-mentioned state transitions for D flip flop from the present state(Qn) to the next
state(Qn+1) for the corresponding excitation inputs are filled in the table to get the excitation
table.
T flip flop
The following figure shows the truth table of the T flip flop, from which the excitation table is
derived.
From the truth table, we can observe that, when the T input is 0, there is no change in the state.
So for the state transition from the present state to the next state, i.e., from Qn = 0 to Qn+1 = 0
and from Qn = 1 to Qn+1 = 1, the excitation input require is T = 0. It is filled in the first and the
fourth row in the excitation table.
Similarly, from the truth table, we can also observe, when T = 1, the state of the flip flop toggles
or is complimented. Thus, for the transition of the state from either 0 to 1 or from 1 to 0, the
excitation input is T = 1. It is filled in the second and third rows of the excitation table.
ANS:-
J = D
K = D'
Step-3:
We construct the circuit diagram of the conversion of JK flip-flop into D flip-flop.
UNIT-IV
BASIC STRUCTURE OF COMPUTER SYSTEM
Short Questions
1.What is the role of MAR and MDR?
ANS:- memory address register (MAR) - holds the address of the current instruction that is to be
fetched from memory, or the address in memory to which data is to be transferred. memory data
register (MDR) - holds the contents found at the address held in the MAR, or data which is to be
transferred to primary memory.
ANS:- Direct memory access (DMA) is the process of transferring data without the
involvement of the processor itself. It is often used for transferring data to/from input/output
devices. A separate DMA controller is required to handle the transfer. The controller notifies the
DSP processor that it is ready for a transfer.
DMA is useful when dealing with data generated at a very high and very low speed.
In high speed data transfers, like from USB and Ethernet, data is typically handled by
complex peripherals that can deal with the blocks of data being transferred
ANS:- Indirect Addressing Mode: This is the mode of addressing where the instruction
contains the address of the location where the target address is stored. So in this way, it is
Indirectly storing the address of the target location in another memory location. So it is called
Indirect Addressing mode.
1.
The program counter (PC) is a register that manages the memory address of the instruction
to be executed next. The address specified by the PC will be + n (+1 for a 1-word instruction
and +2 for a 2-word instruction) each time one instruction is executed.
ANS:- It is composed of three main stages: the fetch stage, the decode stage, and the
execute stage.
Long Questions
1. (a) with a neat sketch Explain the various functional blocks of computer and the way they
communicate with each other.
Input Unit :The input unit consists of input devices that are attached to the computer. These devices
take input and convert it into binary language that the computer understands. Some of the common
input devices are keyboard, mouse, joystick, scanner etc.
Central Processing Unit (CPU) : Once the information is entered into the computer by the input
device, the processor processes it. The CPU is called the brain of the computer because it is the
control center of the computer. It first fetches instructions from memory and then interprets them so
as to know what is to be done. If required, data is fetched from memory or input device. Thereafter
CPU executes or performs the required computation and then either stores the output or displays on
the output device. The CPU has three main components which are responsible for different functions
– Arithmetic Logic Unit (ALU), Control Unit (CU) and Memory registers
Arithmetic and Logic Unit (ALU) : The ALU, as its name suggests performs mathematical
calculations and takes logical decisions. Arithmetic calculations include addition, subtraction,
multiplication and division. Logical decisions involve comparison of two data items to see which one
is larger or smaller or equal.
Control Unit : The Control unit coordinates and controls the data flow in and out of CPU and also
controls all the operations of ALU, memory registers and also input/output units. It is also responsible
for carrying out all the instructions stored in the program. It decodes the fetched instruction, interprets
it and sends control signals to input/output devices until the required operation is done properly by
ALU and memory.
Memory Registers : A register is a temporary unit of memory in the CPU. These are used to store
the data which is directly used by the processor. Registers can be of different sizes(16 bit, 32 bit, 64
bit and so on) and each register inside the CPU has a specific function like storing data, storing an
instruction, storing address of a location in memory etc. The user registers can be used by an
assembly language programmer for storing operands, intermediate results etc. Accumulator (ACC) is
the main register in the ALU and contains one of the operands of an operation to be performed in the
ALU.
Memory : Memory attached to the CPU is used for storage of data and instructions and is called
internal memory The internal memory is divided into many storage locations, each of which can store
data or instructions. Each memory location is of the same size and has an address. With the help of
the address, the computer can read any memory location easily without having to search the entire
memory. when a program is executed, it’s data is copied to the internal memory and is stored in the
memory till the end of the execution. The internal memory is also called the Primary memory or Main
memory. This memory is also called as RAM, i.e. Random Access Memory. The time of access of
data is independent of its location in memory, therefore this memory is also called Random Access
memory (RAM). Read this for different types of RAMs
Output Unit : The output unit consists of output devices that are attached with the computer. It
converts the binary data coming from CPU to human understandable form. The common output
devices are monitor, printer, plotter etc.
Computer Registers
Registers are a type of computer memory used to quickly accept, store, and transfer data and
instructions that are being used immediately by the CPU. The registers used by the CPU are
often termed as Processor registers.
A processor register may hold an instruction, a storage address, or any data (such as bit
sequence or individual characters).
The computer needs processor registers for manipulating data and a register for holding a
memory address. The register holding the memory location is used to calculate the address of
the next instruction after the execution of the current instruction is completed.
Following is the list of some of the most common registers used in a basic computer:
The following image shows the register and memory configuration for a basic computer.
o The Memory unit has a capacity of 4096 words, and each word contains 16 bits.
o The Data Register (DR) contains 16 bits which hold the operand read from the memory
location.
o The Memory Address Register (MAR) contains 12 bits which hold the address for the
memory location.
o The Program Counter (PC) also contains 12 bits which hold the address of the next
instruction to be read from memory after the current instruction is executed.
o The Accumulator (AC) register is a general purpose processing register.
o The instruction read from memory is placed in the Instruction register (IR).
o The Temporary Register (TR) is used for holding the temporary data during the
processing.
o The Input Registers (IR) holds the input characters given by the user.
o The Output Registers (OR) holds the output after processing the input data.
Interrupt Cycle:
After the execute cycle is completed, a test is made to determine if an interrupt was
enabled (e.g. so that another process can access the CPU)
If not, instruction cycle returns to the fetch cycle
If so, the interrupt cycle might performs the following tasks: (simplified...)
move the current value of PC into MBR
move the PC-save-address into MAR
move the interrupt-routine-address into PC
move the contents of the address in MBR into indicated memory cell
continue the instruction cycle within the interrupt routine
after the interrupt routine finishes, the PC-save-address is used to reset the value of PC
and program execution can continue
flowchart of interrupt cycle
The Input Output Processor is a specialized processor which loads and stores data into memory along
with the execution of I/O instructions. It acts as an interface between system and devices. It involves a
sequence of events to executing I/O operations and then store the results into the memory.
3. Write short notes on
i) Instruction format
ans:- Instruction includes a set of operation codes and operands that manage with the
operation codes. Instruction format supports the design of bits in an instruction. It contains
fields including opcode, operands, and addressing mode.
The instruction length is generally preserved in multiples of the character length, which is 8 bits.
When the instruction length is permanent, several bits are assigned to opcode, operands, and
addressing modes.
The function of allocating bits in the instruction can be interpreted by considering the following
elements −
The term Stored Program Control Concept refers to the storage of instructions in computer
memory to enable it to perform a variety of tasks in sequence or intermittently.
The idea was introduced in the late 1040s by John von Neumann who proposed that a program
be electronically stored in the binary-number format in a memory device so that instructions
could be modified by the computer as determined by intermediate computational results.
ENIAC (Electronic Numerical Integrator and Computer) was the first computing system
designed in the early 1940s. It was based on Stored Program Concept in which machine use
memory for processing data.
ans:- The strobe control technique of asynchronous data transfer operates a single control line
to time each transfer. The strobe can be activated by either the source or the destination unit.
The diagram shows a source-initiated transfer. The data bus gives the binary data from the
source unit to the destination unit
Explanation :
The CPU initializes the DMA by sending the given information through the data bus.
The starting address of the memory block where the data is available (to read) or where data are to be
stored (to write).
It also sends word count which is the number of words in the memory block to be read or write.
Control to define the mode of transfer such as read or write.
A control to begin the DMA transfer.
Handshaking Method
The strobe method has the disadvantage that the source unit that initiates the transfer has no
way of knowing whether the destination has received the data that was placed in the bus.
Similarly, a destination unit that initiates the transfer has no way of knowing whether the source
unit has placed data on the bus.
So this problem is solved by the handshaking method. The handshaking method introduces a
second control signal line that replays the unit that initiates the transfer.
In this method, one control line is in the same direction as the data flow in the bus from the
source to the destination. The source unit uses it to inform the destination unit whether there
are valid data in the bus.
The other control line is in the other direction from the destination to the source. This is because
the destination unit uses it to inform the source whether it can accept data. And in it also, the
sequence of control depends on the unit that initiates the transfer. So it means the sequence of
control depends on whether the transfer is initiated by source and destination.
o Source initiated handshaking: In the below block diagram, you can see that two
handshaking lines are "data valid", which is generated by the source unit, and "data
accepted", generated by the destination unit.
The timing diagram shows the timing relationship of the exchange of signals between
the two units. The source initiates a transfer by placing data on the bus and enabling its
data valid signal. The destination unit then activates the data accepted signal after it
accepts the data from the bus.
The source unit then disables its valid data signal, which invalidates the data on the bus.
After this, the destination unit disables its data accepted signal, and the system goes into
its initial state. The source unit does not send the next data item until after the
destination unit shows readiness to accept new data by disabling the data accepted
signal.
This sequence of events described in its sequence diagram, which shows the above
sequence in which the system is present at any given time.
o Destination initiated handshaking: In the below block diagram, you see that the two
handshaking lines are "data valid", generated by the source unit, and "ready for data"
generated by the destination unit.
Note that the name of signal data accepted generated by the destination unit has been
changed to ready for data to reflect its new meaning.
The destination transfer is initiated, so the source unit does not place data on the data
bus until it receives a ready data signal from the destination unit. After that, the
handshaking process is the same as that of the source initiated.
The sequence of events is shown in its sequence diagram, and the timing relationship
between signals is shown in its timing diagram. Therefore, the sequence of events in
both cases would be identical.
ANS:-
ANS:-
Common Bus System
We shall study the common bus system of a very basic computer in this article. A basic computer has 8
registers, memory unit and a control unit. The diagram of the common bus system is as shown below.
Connections:
The outputs of all the registers except the OUTR (output register) are connected to the common bus. The
output selected depends upon the binary value of variables S2, S1 and S0. The lines from common bus
are connected to the inputs of the registers and memory. A register receives the information from the bus
when its LD (load) input is activated while in case of memory the Write input must be enabled to receive
the information. The contents of memory are placed onto the bus when its Read input is activated.
Various Registers:
4 registers DR, AC, IR and TR have 16 bits and 2 registers AR and PC have 12 bits. The INPR and
OUTR have 8 bits each. The INPR receives character from input device and delivers it to the AC while
the OUTR receives character from AC and transfers it to the output device. 5 registers have 3 control
inputs LD (load), INR (increment) and CLR (clear). These types of registers are similar to a binary
counter.
Abbreviation Register name
TR Temporary register
IR Instruction register
AC Accumulator
DR Data register
PC Program counter
Abbreviation Register name
AR Address register
Short Questions
1. Explain cache hit?
ANS:- A "cache hit" occurs when a file is requested from a cache and the cache is
able to fulfill that request.
A cache hit describes the situation where your site's content is successfully
served from the cache. The tags are searched in the memory rapidly, and when the
data is found and read, it's considered as a cache hit. A cache hit is when content is
successfully served from the cache instead of the server
ANS:-
Long Questions
1. a) define mapping? Explain three mapping techniques of memory in detail?
ANS:- Memory Mapping and its types
Memory Mapping
The translation between the logical address space and the physical memory is known
as Memory Mapping. To translate from logical to a physical address, to aid in memory
protection also to enable better management of memory resources are objectives of memory
mapping.
During cache mapping, the block is not brought from the main memory but the main memory
block is simply copied to the cache. Cache memory generally tends to operate in some different
configurations,
1. Direct mapping
2. Fully associative mapping
3. Set associative mapping
1) Direct Mapping
In Direct mapped cache memory, each block mapped to exactly one location in cache memory.
A particular block of main memory can map the line number of cache is given by - Cache line
number = (Block Address of Main Memory) modulo (Number of lines in Cache).
The direct-mapped cache is like rows in a table with three columns' main memory address are
bits for Offset, Index, and Tag. The size of the fields depends on the capacity of memory and size
of the block in the cache.
The least significant w bits are used to identify a word within a block of main memory. Tag
corresponds to the remaining bits are used to determine the proper block of main memory. Line
off-set or block is used to select a block to be accessed out of total blocks are available
according to the capacity of the cache.
The data block or cache line that contains the actual data fetched and stored, a tag with all or
part of the address of the data that was fetched, and a flag bit that shows the presence in the
row entry of a valid bit of data.
2) Associative Mapping
In this type of mapping, any main memory block can go in any line of the cache. So we have to
use proper replacement policy to replace a block from the cache if the required block of main
memory is not present in the cache. Here, the main memory is divided into two fields: word field
identifies which word in the block is needed and the tag field identifies the block. It is
considered to be the fastest and the most flexible mapping form of cache mapping.
3) Set-associative Mapping
In this mapping technique, blocks of cache are grouped to form a set and a block of main
memory can go into any block of a specific set.
Set Associative Mapping of Cache
This form of mapping removes the drawbacks of direct mapping. In Set-associative mapping,
each word that is present in the cache can have two or more words in the main memory for the
same index address. Set associative cache mapping is a combination of direct and associative
cache mapping techniques.
This also reduces searching overhead present in the associative mapping. Here, searching is
restricted to the number of sets instead of the number of blocks.
ROM stands for Read-Only Memory. It is a non-volatile memory that is used to stores
important information which is used to operate the system. As its name refers to read-only
memory, we can only read the programs and data stored on it. It is also a primary memory
unit of the computer system. It contains some electronic fuses that can be programmed for a
piece of specific information. The information stored in the ROM in binary format. It is also
known as permanent memory.
Features of ROM (Read-Only Memory):
ROM is a non-volatile memory.
Information stored in ROM is permanent.
Information and programs stored on it, we can only read.
Information and programs are stored on ROM in binary format.
It is used in the start-up process of the computer.
Types of Read-Only Memory (ROM):
1. MROM (Masked read-only memory)
2. PROM (Programmable read-only memory)
3. EPROM (Erasable programmable read-only memory)
4. EEPROM (Electrically erasable programmable read-only memory)
Now we will discuss the types of ROM one by one:
1. MROM (Masked read-only memory): We know that ROM is as old as semiconductor
technology. MROM was the very first ROM that consists of a grid of word lines and bit lines
joined together transistor switches. This type of ROM data is physically encoded in the circuit
and only be programmed during fabrication. It was not so expensive.
2. PROM (Programmable read-only memory): PROM is a form of digital memory. In this
type of ROM, each bit is locked by a fuse or anti-fuse. The data stored in it are permanently
stored and can not be changed or erasable. It is used in low-level programs such as firmware
or microcode.
3. EPROM (Erasable programmable read-only memory): EPROM also called EROM, is a
type of PROM but it can be reprogrammed. The data stored in EPROM can be erased and
reprogrammed again by ultraviolet light. Reprogrammed of it is limited. Before the era of
EEPROM and flash memory, EPROM was used in microcontrollers.
4. EEPROM (Electrically erasable programmable read-only memory): As its name refers,
it can be programmed and erased electrically. The data and program of this ROM can be
erased and programmed about ten thousand times. The duration of erasing and programming
of the EEPROM is near about 4ms to 10ms. It is used in microcontrollers and remote keyless
systems.
2. Explain the following secondary storage devices
i) Magnetic disk
Magnetic disks: A magnetic disk is a storage device that uses a magnetization process to write,
rewrite and access data. It is covered with a magnetic coating and stores data in the form of
tracks, spots and sectors. Hard disks, zip disks and floppy disks are common examples of
magnetic disks.
i. Floppy Disk: A floppy disk is a flexible disk with a magnetic coating on it, and it is
packaged inside a protective plastic envelope. These are among the oldest portable
storage devices that could store up to 1.44 MB of data, but now they are not used due to
very little memory storage.
ii. Hard Disk Drive (HDD): Hard disk drive comprises a series of circular disks
called platters arranged one over the other almost ½ inches apart around a spindle.
Disks are made of non-magnetic material like aluminium alloy and coated with 10-20 nm
magnetic material. The standard diameter of these disks is 14 inches, and they rotate
with speeds varying from 4200 rpm (rotations per minute) for personal computers to
15000 rpm for servers.
Data is stored by magnetizing or demagnetizing the magnetic coating. A magnetic
reader arm is used to read data from and write data to the disks. A typical modern HDD
has a capacity in terabytes (TB).
2. Optical Disk: An optical disk is any computer disk that uses optical storage techniques and
technology to read and write data. It is a computer storage disk that stores data digitally and
uses laser beams to read and write data.
i. CD Drive: CD stands for Compact Disk. CDs are circular disks that use optical rays,
usually lasers, to read and write data. They are very cheap as you can get 700 MB of
storage space for less than a dollar. CDs are inserted in CD drives built into the CPU
cabinet. They are portable as you can eject the drive, remove the CD and carry it with
you. There are three types of CDs:
o CD-ROM (Compact Disk - Read Only Memory): The manufacturer recorded the
data on these CDs. Proprietary Software, audio or video are released on CD-
ROMs.
o CD-R (Compact Disk - Recordable): The user can write data once on the CD-R.
It cannot be deleted or modified later.
o CD-RW (Compact Disk - Rewritable): Data can repeatedly be written and
deleted on these optical disks.
ii. DVD Drive: DVD stands for digital video display. DVD is an optical device that can store
15 times the data held by CDs. They are usually used to store rich multimedia files that
need high storage capacity. DVDs also come in three varieties - read-only, recordable
and rewritable.
iii. Blu Ray Disk: Blu Ray Disk (BD) is an optical storage media that stores high definition
(HD) video and other multimedia files. BD uses a shorter wavelength laser than CD/DVD,
enabling the writing arm to focus more tightly on the disk and pack in more data. BDs
can store up to 128 GB of data.
3 a) tabulate comparison between different memories in terms of speed, size and cost?
b) Draw static RAM cell. Explain its read write operation and write its merits and
demerits?
ANS:-
Static Memories: Memories that consist of circuits capable of retaining their state as long as power is
applied are known as static memory.
These transistors act as switches that can be opened / closed under the control of the word line.
When the word line is at ground level, the transistors are turned off and the latch retain its state.
Read Operation:
In order to read the state of the SRAM cell, the word line is activated to close switches T1 and T2.
If the cell is in state 1, the signal on bit line b is high and the signal on the bit line b is low. Thus b and b
are complements of each other.
Sense / write circuit at the end of the bit line monitors the state of b and b’ and set the output
accordingly. Write Operation:
The state of the cell is set by placing the appropriate value on bit line b and its complement on b and
then activating the word line. This forces the cell into the corresponding state.
The required signal on the bit lines are generated by Sense / Write circuit.
Transistor pairs (T3, T5) and (T4, T6) form the inverters in the latch.
In state 1, the voltage at point X is high by having T5, T6 on and T4, T5 are OFF.
Thus T1 and T2 returned ON (Closed), bit line b and b will have high and low signals respectively.
The CMOS requires 5V (in older version) or 3.3.V (in new version) of power supply voltage.
The continuous power is needed for the cell to retain its state Merit :
It has low power consumption because the current flows in the cell only when the cell is being
activated accessed.
Static RAM’s can be accessed quickly. It access time is few Nano seconds. Demerit:
SRAM’s are said to be volatile memories because their contents are lost when the power is
interrupted.
4.a) illustrate virtual memory address translation with the help of neat sketch?
ANS:- Virtual Memory:-
1) Virtual Memory was introduced in the system in order to increase the size the size of memory.
2) A hardware unit called Memory Management Unit (MMU) translates Virtual addresses into
physical addresses.
3) If CPU wants data from main memory and it is not present in main memory then MMU
causes operating system to bring the data into the Memory from disk.
4) As the disk limit is beyond the main memory address, the desired data address has to be
translated from Virtual to physical address. MMU does the address translation.
5) Figure below shows Virtual Memory Organization:-
ANS:-
1. Swapping
When process is to be executed then that process is taken from secondary memory to stored in RAM.But
RAM have limited space so we have to take out and take in the process from RAM time to time. This
process is called swapping. The purpose is to make a free space for other processes. And later on, that
process is swapped back to the main memory.
The Round Robin algorithm is executing in which quantum process is supposed to preempt after
running for some time. In that case, that process is swapped out, and the new process is swapped in.
When there is a priority assigned to each process, the process with low priority is swapped out, and the
higher priority process is swapped in. After its execution, the lower priority process is again swapped
in, and this process is so fast that users will not know anything about it.
In shortest time remaining first algorithm when the next process(which arrive in ready queue) is having
less burst time,then executing process is preempted.
When process have to do I/O operations,then that process temporaily swapped out.
Swap-in: Swap-in means removing a program from the hard disk and putting it back in the RAM.
Swap-out: Swap-out means removing a program from the RAM and putting it into the hard disk.
2. Paging
Paging is the memory management technique in which secondary memory is divided into fixed-size
blocks called pages, and main memory is divided into fixed-size blocks called frames. The Frame has the
same size as that of a Page. The processes are initially in secondary memory, from where the processes
are shifted to main memory(RAM) when there is a requirement. Each process is mainly divided into parts
where the size of each part is the same as the page size. One page of a process is mainly stored in one of
the memory frames. Paging follows no contiguous memory allocation. That means pages in the main
memory can be stored at different locations in the memory.
3. Compaction
Compaction is a memory management technique in which the free space of a running system is
compacted, to reduce fragmentation problem and improve memory allocation efficiency. Compaction is
used by many modern operating systems, such as Windows, Linux, and Mac OS X. As in the fig we have
some used memory(black color) and some unused memory(white color).The used memory is
combined.All the empty spaces are combined together.This process is called compaction.This is done to
prevent to solve the problem of fragmentation, but it requires too much of CPU time.
By compacting memory, the operating system can reduce or eliminate fragmentation and make it easier
for programs to allocate and use memory.
Copying all pages that are not in use to one large contiguous area.
Then write the pages that are in use into the newly freed space.
4. Segmentation
Segmentation is another memory management technique used by operating systems. The process is
divided into segments of different sizes and then put in the main memory. The program/process is divided
into modules, unlike paging, in which the process was divided into fixed-size pages or frames. The
corresponding segments are loaded into the main memory when the process is executed. Segments
contain the program’s utility functions, main function, and so on.
5.a) draw and explain block diagram of synchronos DRAM along with its timing diagram?
SynchronousDRAM(SDRAM) –
These RAM chips’ access speed is directly synchronized with the CPU’s clock. For this, the
memory chips remain ready for operation when the CPU expects them to be ready. These
memories operate at the CPU-memory bus without imposing wait states. SDRAM is
commercially available as modules incorporating multiple SDRAM chips and forming the
required capacity for the modules.
b) write short notes on cache memory and its uses?
Cache Memory is a special very high-speed memory. It is used to speed up and synchronize
with high-speed CPU. Cache memory is costlier than main memory or disk memory but more
economical than CPU registers. Cache memory is an extremely fast memory type that acts as
a buffer between RAM and the CPU. It holds frequently requested data and instructions so
that they are immediately available to the CPU when needed. Cache memory is used to
reduce the average time to access data from the Main memory. The cache is a smaller and
faster memory that stores copies of the data from frequently used main memory locations.
There are various different independent caches in a CPU, which store instructions and data