Académique Documents
Professionnel Documents
Culture Documents
INPUT DEVICE: used to enter data and programs into a computer system. We input
data and instructions into the computer.
MEMORY:
o MAIN MEMORY:
Also called primary memory.
It is volatile i.e the contents are lost if a power failure or a system crash
occurs.
Computer programs must be in main memory to be executed.
Its size is small and it is expensive.
Ex: RAM.
Main memory can be accessed directly . So we want all the data to reside
in main memory, which is not possible because of 2 reasons:
a. Main memory is usually too small to store all the needed programs
and data permanently.
b. It is volatile and hence data is lost. So, we need secondary storage.
o SECONDARY MEMORY:
permanently.
Speed is slow.
Cost is low.
Ex: Hard disk drive (HDD), FDD (Floppy disk Drive), Pendrive etc.
o CACHE MEMORY:
OUTPUT DEVICE: Output Unit of a computer provides the information and results
of a computation to outside world.
Ex: Printers, Monitors, FDD, HDD.
Instruction Register.
Operations performed by registers are:
LDA 3001
ADC #3
STA 3001
the
accumulator
into
main
ii.
called
and returns. A transfer that is conditional on the truth of some assertion lets the
computer follow a different sequence under different conditions.
o A branch provides that the next instruction is fetched from somewhere else in
memory.
o When the computer restarts or is reset, the program counter normally reverts
to 0.
o For example if the program counter has the address 305 then the next
instruction will be at location 305 in main memory (RAM). When a program
is running, the program counter will often just be incrementing as it addresses
one instruction after the other, e.g. 305, 306, 307.
v.
o The contents of an index register is added to (in some cases subtracted from)
an immediate address (one that is part of the instruction itself) to form the
"effective" address of the actual data (operand).
vi.
ADDRESS BUS:- When CPU reads data/instruction from or writes data to memory,
it must specify the address of the new location it wishes to access.
o CPU puts this address on the bus, memory takes the location as input and uses it
to access that location.
o All the components like keyboard, monitor or disk drive has a unique address as
well. While accessing address of such devices, CPU places address of that
particular device on the address bus. Each device reads the address placed on the
address bus and the designated device comes to know that it is being accessed.
o Address bus is unidirectional i.e. CPU can only place data on this bus , CPU never
reads data from it.
DATA BUS: Data is transferred using data buses.
o Fetch: When CPU fetches data from memory, it first places the memory
address on the address bus, the memory the outputs the data on the data bus
which is then read by the CPU.
o Write: CPU outputs the address on the address bus and then places data on the
data bus. Memory, then reads data and stores that data at the memory location
indicated by the address bus.
o It is bidirectional.
CONTROL BUS: Used by CPU for communicating with other devices within the
computer.
o Control bus carries the commands from the CPU and returns status signals
from the devices.
o Lines:
Read (R) single line that when active (at 0) indicates that device is
device.
Bus request: Indicates that the device is requesting to access the bus.
Reset : reset the system.
Clock Signals: The signals on this line are used to synchronise data
Disadvantages of buses:
a.
b.
performed operation.
ALU also exchanges additional information with a status register, which relates to the
result of the current or previous operations.
Signals
An ALU has a variety of input and output nets, which are the shared electrical connections
used to convey digital signals between the ALU and external circuitry. When an ALU is
operating, external circuits apply signals to the ALU inputs and, in response, the ALU
produces and conveys signals to external circuitry via its outputs.
Data
A basic ALU has three parallel data buses consisting of two input operands (A and B) and a
result output (Y). Each data bus is a group of signals that conveys one binary integer number.
Typically, the A, B and Y bus widths (the number of signals comprising each bus) are
identical and match the native word size of the encapsulating CPU (or other processor).
Opcode
The opcode input is a parallel bus that conveys to the ALU an operation selection code,
which is an enumerated value that specifies the desired arithmetic or logic operation to be
performed by the ALU. The opcode size (its bus width) is related to the number of different
operations the ALU can perform; for example, a four-bit opcode can specify up to sixteen
different ALU operations. Generally, an ALU opcode is not the same as a machine language
opcode, though in some cases it may be directly encoded as a bit field within a machine
language opcode.
Status
The status outputs are various individual signals that convey supplemental information about
the result of an ALU operation. These outputs are usually stored in registers so they can be
used in future ALU operations or for controlling conditional branching. The collection of bit
registers that store the status outputs are often treated as a single, multi-bit register, which is
referred to as the "status register" or "condition code register". General-purpose ALUs
commonly have status signals such as:
Carry-out, which conveys the carry resulting from an addition operation, the borrow
resulting from a subtraction operation, or the overflow bit resulting from a binary shift
operation.
Zero, which indicates all bits of the Y bus are logic zero.
Overflow which indicates the result of an arithmetic operation has exceeded the
numeric range of the Y bus.
Parity which indicates whether an even or odd number of bits on the Y bus are logic
one.
The status input allows additional information to be made available to the ALU when
performing an operation. Typically, this is a "carry-in" bit that is the stored carry-out from a
previous ALU operation.
CIRCUIT OPERATION:
An ALU is a combinational logic circuit, meaning that its outputs will change
FUNCTIONS:
Arithmetic operations
Add: A and B are summed and the sum appears at Y and carry-out.
Add with carry: A, B and carry-in are summed and the sum appears at Y and carryout.
Subtract: B is subtracted from A (or vice-versa) and the difference appears at Y and
carry-out. For this function, carry-out is effectively a "borrow" indicator. This operation
may also be used to compare the magnitudes of A and B; in such cases the Y output may
be ignored by the processor, which is only interested in the status bits (particularly zero
and negative) that result from the operation.
Subtract with borrow: B is subtracted from A (or vice-versa) with borrow (carry-in)
and the difference appears at Y and carry-out (borrow out).
Two's complement (negate): A (or B) is subtracted from zero and the difference
appears at Y.
Pass through: all bits of A (or B) appear unmodified at Y. This operation is typically
used to determine the parity of the operand or whether it is zero or negative.
Arithmetic
Logical
Left shift
Right shift
Rotate
ALU shift operations cause operand A (or B) to shift left or right (depending on the opcode)
and the shifted operand appears at Y.
Arithmetic shift: the operand is treated as a two's complement integer, meaning that
the most significant bit is a "sign" bit and is preserved.
Logical shift: a logic zero is shifted into the operand. This is used to shift unsigned
integers.
Rotate: the operand is treated as a circular buffer of bits so its least and most
significant bits are effectively adjacent.
Rotate through carry: the carry bit and operand are collectively treated as a circular
buffer of bits.
Although an ALU can be designed to perform complex functions, the resulting higher circuit
complexity, cost, power consumption and larger size makes this impractical in many cases.
Consequently, ALUs are often limited to simple functions that can be executed at very high
speeds (i.e., very short propagation delays), and the external processor circuitry is responsible
for performing complex functions by orchestrating a sequence of simpler ALU operations.
units (ALUs),
and computer
memory,
all
the
way
up
through
complete microprocessors, which may contain more than 100 million gates.
In modern practice, most gates are made from field-effect transistors (FETs),
AND GATE
A circuit which performs an AND operation is shown in figure. It has n input (n >= 2) and
one output.
OR GATE
A circuit which performs an OR operation is shown in figure. It has n input (n >= 2) and one
output.
NOT GATE
NOT gate is also known as Inverter. It has one input A and one output Y.
NAND GATE
A NOT-AND operation is known as NAND operation. It has n input (n >= 2) and one
output.
NOR GATE
A NOT-OR operation is known as NOR operation. It has n input (n >= 2) and one output.
XOR GATE
XOR or Ex-OR gate is a special type of gate. It can be used in the half adder, full adder and
subtractor. The exclusive-OR gate is abbreviated as EX-OR gate or sometime as X-OR gate.
It has n input (n >= 2) and one output.
XNOR GATE
XNOR gate is a special type of gate. It can be used in the half adder, full adder and
subtractor. The exclusive-NOR gate is abbreviated as EX-NOR gate or sometime as X-NOR
gate. It has n input (n >= 2) and one output.
MULTIPLEXER:
Multiplexer means many into one. A multiplexer is a circuit used to select and route
Multiposition switches are widely used in many electronics circuits. However circuits
that operate at high speed require the multiplexer to be automatically selected.
Multiplexer handle two type of data that is analog and digital. For analog application,
multiplexer are built of relays and transistor switches. For digital application, they are
The 4-to-1 multiplexer has 4 input bit, 2 control bits, and 1 output bit. The four input bits are
D0,D1,D2 and D3. only one of this is transmitted to the output y. The output depends on the
value of AB which is the control input. The control input determines which of the input data
bit is transmitted to the output.
For instance, as shown in fig. when AB = 00, the upper AND gate is enabled while all other
AND gates are disabled. Therefore, data bit D0 is transmitted to the output, giving Y = Do.
If the control input is changed to AB =11, all gates are disabled except the bottom AND gate.
In this case, D3 is transmitted to the output and Y = D3.
Multiplexer are used in various fields where multiple data need to be transmitted using a
single line. Following are some of the applications of multiplexers
signals can be isolated and eventually, the desire audio signals reach the intended
recipients.
DEMULTIPLEXER:
The 1-to-4 demultiplexer has 1 input bit, 2 control bit, and 4 output bits. An example
of 1-to-4 demultiplexer is IC 74155. The 1-to-4 demultiplexer is shown in figure
below-
The input bit is labelled as Data D. This data bit is transmitted to the data bit of the output
lines. This depends on the value of AB, the control input.
When AB = 01, the upper second AND gate is enabled while other AND gates are disabled.
Therefore, only data bit D is transmitted to the output, giving Y1 = Data.
If D is low, Y1 is low. IF D is high,Y1 is high. The value of Y1 depends upon the value of D.
All other outputs are in low state.
If the control input is changed to AB = 10, all the gates are disabled except the third AND
gate from the top. Then, D is transmitted only to the Y2 output, and Y2 = Data.
Applications of Demultiplexer:
1.
2.
3.
ALU (Arithmetic Logic Unit) In an ALU circuit, the output of ALU can be stored
in multiple registers or storage units with the help of demultiplexer. The output of ALU
is fed as the data input to the demultiplexer. Each output of demultiplexer is connected
to multiple register which can be stored in the registers.
4.