You are on page 1of 48

Chapter-1

Introduction
• Logic Gates:
• Digital computer uses binary number system for its operation.
• Binary system has only two digits 0’s and 1’s.
• Computer
– Receives
– Stores
– Understands
– Manipulates information composed of 0’s and 1’s.
• Manipulation of binary information is done by logic circuits is
called as logic gates.
• The logic operations are
– AND
– OR
– NOT
– NAND
– NOR
– Exclusive –OR
– Exclusive-NOR
• An electronic circuit which performs a logic operation is called
as logic gates.
• Electronic circuit which performs AND operation is called as
AND gate.
• AND Gate:
• It has two inputs and one output.
• Input signal applied to a gate has only two stable states
– 1- HIGH
– 0- LOW
• No intermediate state.
• Logical operation of AND gate is called as AND operation.
• AND Gate:

A B
Bulb

A Circuit containing two switches.


– The current will flow in the circuit only when both
switches A and B are closed.
– The ON state is taken as logic 1 and OFF is 0.
– When both switches are ON. A and B have logic 1 then the
output is 1 otherwise 0.
• Truth Table:
– A table which shows the value of dependent variable for
all possible values of independent variables is called as
truth table.
Input Output
A B y=AB
0 0 0
0 1 0
1 0 0
1 1 1
– Λ denotes AND operation
– A and B are independent variables
– Y is dependent variable.
• OR Gate:
• Also known as Inclusive –OR gate.
• Two or more inputs but only one output.
• The output will be HIGH(1) if at least any one of the input is
HIGH (1) else LOW(0).
• The logical operation is called as OR operation.
• V denotes OR operation.
• OR Gate
• A circuit containing two switches in parallel.

Bulb

• The current will flow in the circuit when either switches is in


ON position. The current will not flow when both switches in
OFF position.
• Truth Table
• Input Output
A B Y=A+B
0 0 0

0 1 1
1 0 1
1 1 1
• NOT Gate:
– It has one input and one output. Y=Ā
– It is also called as inverter.
– Output is complement of the input signal. Output
is 1 when the input is 0.
• It is used to invert the logic levels. Low to high
or high to low.

• Truth Table:
Input Output
A Y=Ā
0 1
1 0
• NAND Gate:
– It has two or more inputs but only one output.
– It is the complement of the AND function.
– AND gate can be combined with an inverter to form a
NAND gate.
– The output can be given by
• Truth Table:
Input Output
A B F
0 0 1
0 1 1
1 0 1
1 1 0
– NAND operation is also called as Universal Operation.
– Universal operation is one that can be used to implement
the three basic logic operation AND, OR and NOT.
• NOR Gate:
– It has two or more inputs and only one output.
– It is a complement of OR function.
– OR gate can be combined with inverter to form NOR gate.
• The output can be written as

• Exclusive –OR gate:


• The output is high only when its inputs are different.
• Output is low when both inputs A and B are same.
• It is also called as modulo-2 sum operation.
• The output can be represented as F= A B.
• Truth Table:
Input Output
A B F
0 0 0
0 1 1
1 0 1
1 1 0
Exclusive- NOR Gate:
– It is the complement of XOR operation.
– Output is high only when the logic values of both inputs A
and B are Same. That is 0 or 1.
– Output is low when inputs are different .
• Truth Table:
Input Output
A B F
0 0 0
0 1 1
1 0 1
1 1 0
2. Boolean Algebra:
– It is an algebra of logic.
– One of the most basic tools to analyze and design logic
circuits.
– Purpose is to simplify logical statements and solve logic
problems.
• AND Operation:
Truth Table:
X Y X AND Y
T T T
T F F
F T F
F F F
Symbolic Form/ Notation:
X Y X.Y
1 1 1
1 0 0
0 1 0
0 0 0
• OR Operation:
Truth Table:
X Y X OR Y
T T T
T F T
F T T
F F F
Symbolic Form/ Notation:
X Y X +Y
1 1 1
1 0 1
0 1 1
0 0 0
• NOT Operation:
Truth Table:
X NOT X
T F
F T
Symbolic Form/ Notation:
X NOT X
1 0
0 1
• Boolean Variables, operations and functions:
– Binary digital system operates on electrical signals of two
possible states.
• HIGH [5 Volt] - 1
• LOW [0 Volt] - 0
• Signals:
– The signals are two types
• Constant signal
• Variable signal
• Constant Signal:
– A signal does not change its state/value in time.
• Variable Signal:
– A Signal which change its state in time.
• Boolean variables or Logic Variables:
– A variable which has only two values 0 and 1.
– Boolean function consist of Boolean variable.
– EX:- Boolean Variables
– X = A+B.C+C.(D+E)

Expression Literal [ Each Occurrence of Variables]


• It can be written as
– X= F(A,B,C,D,E)
• Boolean Theorems:
• Combinational Circuit:
– Two types of logic circuits
• Combinational circuits
• Sequential circuits
– It is one in which the state of the output at any instant is
entirely determined by the states of input at that time.
– Operations can be completely described by a truth table or
Boolean expression.
– Realized using AND , OR, NOT, NOR and NAND gates.
– Examples
• Adders
• Subtractors
• Encoder
• Decoder , etc.,.
• Flip- Flops:
– A device is said to be bi-stable.
– It has two states SET and RESET.
– Output remains either HIGH or LOW.
• HIGH = 1 - SET
• LOW = 0 - RESET
– It can store binary bit 1 or 0.
• S-R Flip Flop:
– Realized by connecting two NOR gates.
– R and S are inputs and Q is an output. Q is the
complement of the output.
• Truth Table:
R S Q Action
0 0 Last value No Change
0 1 1 SET
1 0 0 RESET
1 1 - Invalid Condition
• J-K Flip Flop:
– In S-R flip flop state of output is unpredictable when S=R=1.
– J-K flip flop allows input J=K=1. Output can be the
complement of the previous state.
• Truth Table:
J K Qn+1
0 0 Qn[ No change remains Last state]
1 0 1
0 1 0
1 1 Qn
• D Flip- Flop:
– It has been developed for one input line.
Truth Table:
Clock D Input Qn+1
0 X Qn
↑ 1 1

↑ 0 0

↓ X Qn [ Last state]

• Sequential Circuit:
– It consist of a combinational logic and storage elements.
– Output is not only the function of the present but also the
past inputs.
– Sequential circuits are
• Registers
• Counters
– Sequential circuits are of two types
• Synchronous
• Asynchronous
– Synchronous:
• Sequential circuits which employ clock.
– Asynchronous:
• Sequential circuits which do not employ clock.
• Data Types:
• Machine instructions operate on data. the categories are
– Addresses
– Numbers
– Characters
– Logical data
• Numbers:
– All machine languages include numeric data types.
– The types are
• Binary Integer
• Binary Floating Point
• Decimal
• Characters:
– A common form of data is text or character strings.
– Most commonly used character code is ASCII.
– Another code used to encode characters are EBCDIC.
• Logical Data:
– Each word or other addressable unit(byte, half word)
treated as a single unit of data.
– An n bit unit as consisting of n1 bit of items of data, each
item having the value 0 or 1.
– When data are viewed they are considered to be logical
data.
• Complements:
– Complements are used to represent negative numbers.
– Two types of complements in binary number system.
• 1’s complement
• 2’s complement.
– 2’s complement is used to represent binary negative
number.
• 1’s Complement:
– To obtain 1’s complement of a binary number each bit of
the binary number is subtracted from 1.
– Example:
• 1’s complement of binary number 010 = 101
• 1’s complement of binary number1110 = 0001
• 1’s complement of binary number 101100 = 010011
• 1’s complement of binary number 0000 = 1111
– Simply change each 1 to 0 and each 0 to 1.
• 2’s Complement:
– 2’s complement of the binary number is equal to 1’s
complement of the number plus one.
• Ex:
• 2’s complement of binary number 0101
=1010 + 1
=1011
• 2’s complement of binary number 101100 = 010100
• 2’s complement of binary number 0000 = 10000
• 2’s complement of binary number 111 = 001
• Adding binary number and its 2’s complement.
1) 1100 and its 2’s complement
Number = 1100
2’s Complement = 0011 + 1 = 0100
Addition
1100
+ 0100
= 10000
carry
2) 1011 and its 2’s Complement
Number = 1011
2’s Complement = 0100 + 1 = 0101
Addition
1011 + 0101 = 10000
3) Add 5 and -5
5 0000 0101
-5  1111 1010 + 1 = 1111 1011
Addition
0000 0101 + 1111 1011  10000 0000
• Binary subtraction using 2’ Complement:
• The addition of 2’ complement of a number is equivalent to its
subtraction.
• Ex: subtract 2 from 6
0110
0010
0100  simple binary subtraction
• Subtraction using 2’s Complement
1’s complement of 0010 1101
2’ complement of 0010 1110
6  0110 (+)
2’s complement  1110
10100
• Subtract 3 from 5:
1’s complement of 3  1100 and 2’s complement of 3  1101
5  0101
3  1101
10010
• Fixed Point Representation:
– In a fixed point system of number representation all
numbers are represented as integers or fractions.
– Signed integers or BCD numbers are called fixed point
representation.
– It does not contains the information regarding the binary
or decimal point
• Binary or decimal point is assumed at the extreme right or left
of the number.
• If the radix point is assumed to be at the extreme left all the
numbers are positive or negative fraction.
• EX:
• 5.85 X 90.38 Multiply
• This will be represented as 585X9038
• Result = 5287230
• The decimal point has to be placed by the programmer
to get correct result 528.7230
• The user has to keep track of radix point which is tedious job.
• Floating Point Representation:
• A number which has integer part as well as a fractional part is
called as real or floating point numbers.
• Either positive or negative.
• Ex:
– Real numbers are
• 215.58, 0.739,-0.586
– Binary real numbers are
• 101.110, 0.1.11, -101.1011,-0.1101
– The real number 546.98 can also written as 5.4698X102.
• 0.009863 as 9.863X10-3
Exponent
• 146.58 as 0.14658X103
Mantissa

• It is known as scientific form of representation.


• A number N may be represented as
N= MRe Exponent
Mantissa Radix
• 3584.69 = 358469X10-2
• It can be represented as
sign sign
0 358469 1 02

Mantissa Exponent
• -563.5896 can be represented as
1. 5635896X103 1 . 5635896 0 03
• -0.000258637 can be represented as
.258637X10-3 0 .258637 1 03
• Floating Point Arithmetic:
• 1. Add .586293X105 and .235000X103
.586293X105
. 002350X 105
.588643X105
• Add .8794X106 and .7635X106
.8794 X106
.7635X106
1.6429X106
• Subtract .39X103 from .4935X105
.4935X105
.0039X105
.4896X105
• Multiply .486X103 with .38X104
(.486X103) (.38X104)
1.8468 X107
.18468X108
• Divide .93800X105 by .3500X102
( .93800X105) / (. 3500X102)  2.6800X103
 0.26800X104
• Codes:
– The different types of codes are
– ASCII and ISCII codes
– EBCDIC codes
– GRAY codes
– ASCII Codes:
– American Standard Code for Information Interchange
used in small computers , peripherals, instruments and
communication devices.
– It is represented by 7 bit code.
– Micro computer uses 8-bit word length. 7- bit is used for
basic code and the 8th bit is used for representing parity bit
. Parity bit may be 0 or 1.
– First 3 bits are Zone bits and remaining 4 bit represent
digit values.
• ISCII code:
– Indian Standard Code for Information Interchange.
– It is an 8-bit code for Indian Languages.
• EBCDIC Code
– EBB – SEE- DICK
– Extended Binary Code Decimal Interchange Code.
– Standard character code for large computers.
– 8-bit code without parity bit.
– 9th bit can be used for parity.
– Up to 256 characters can be coded.
– First 4 bits represent Zone bits and remaining four bits
represents digit values.
• GRAY Code:
– It is a binary code.
– It is used in shaft encoder which indicates the angular
position of a shaft in digital form.
– Only one binary bit changes at a time.
– It uses to reduce the error in reading shaft position.
– It is suitable for a decimal code.
– The transition from 9 back to 0 involves a change of three
bits. Ie) from 1101 to 0000.
• Integrated Circuits:
– Integrated circuit defines the third generation of
computers.
– It exploits the fact that such components as transistors,
resistors and conductors can be fabricated from a
semiconductor such as silicon.
– The early IC’s are referred to as Small Scale
Integration(SSI).
– The interconnections are more reliable than solder
connections.
• Decoders:
– It is a combinational circuit with a number of output lines
only one of which is asserted at anytime dependent on the
pattern of input lines.
– Decoder has n inputs and 2n outputs.
– Mainly used for address decoding.
• Decoder with 3 input and 23 (8) output.
• Multiplexer:
– It connects multiple inputs to a single output. At anytime
one of the input is selected to be passed to the output.
– It is used in digital circuit to control signal and data
routing.
– Truth Table
S2 S1 F
0 0 D0
0 1 D1
1 0 D2
1 1 D3
• Multiplexer Implementation:
• Registers:
– It is a digital circuit used within the CPU to store one or
more bits of data.
– Types of registers
• Parallel Register
• Shift register
• Parallel Register:
– It consist of a set of 1-bit memories that can read or write
simultaneously.
– Used to store data.
• Ex- 8.bit Parallel Register:
– The operation of a parallel register using D Flip Flops.
– A control signal labeled load control writing into register
from signal lines D11 through D18.
• 8- bit Parallel Registers:
• Shift register:
– It accepts AND or OR transfer information serially.
– It can be used to interface to serial Input Output devices.
– It can be used within the ALU to perform logical shift and
rotate functions.
• EX- 5 Bit Shift register.
– Data are input only to the left most flip flop.
– With each clock pulse data are shifted to the right one
position and the right most bit is transferred out.
• Binary Counter:
– Digital counter consist of a number of flip flops.
– Their function is to count electrical pulses.
– It is used to count time interval or frequency.
– Two types of counters
• Synchronous
• Asynchronous
– Time interval – the number of pulses or proportional to
time and Frequency- inversely propositional to time.
• Synchronous Counter:
– All flip flops are clocked simultaneously.
• Asynchronous Counter:
– The flip- flops are not clocked simultaneously. Each flip
flop is triggered by previous flip flop. Also called as ripple
counter.
• Synchronous Counter:

• Asynchronous Counter:
• Memory Units:
– Memory is an essential component of a digital computer.
– Storing device
– It stores program, data, result , etc.
– Three kinds of memory
• Semiconductor memory
• Magnetic memory
• Optical memory
• Semiconductor Memory
– It is faster, compact and lighter.
– It consumes less power
– It is a static device.
– Semiconductor memories are
• RAM [ Static, Dynamic]
• ROM [ PROM, EPROM, EEPROM]
• Magnetic Memory:
– Permanent type memory
– Not volatile
– Used as secondary and backup memory
– Types
• Magnetic disks
– Hard disk, floppy disk
• Magnetic Tapes
• Optical Memory:
– Optical disks are used for backup memories.
– Information is written to or read from an optical disk using
laser beam.
– Has very high storing capacity.
– It is a direct access device.
– Types are CD , CD-R, CD-RW, DVD, DVD-R, DVD-RW

You might also like