SlideShare a Scribd company logo
Chapter 9
Arithmetic Logic unit
Arithmetic Microperations
• Arithmetic Microoperations perform arithmetic
operation on numeric data stored in registers.
The basic arithmetic micro operations are:-
• Addition
• Subtraction
• Increment
• Decrement
©सरोज थापा 3
4
Binary Adder
FA
FA
FA
FA C0
A0
B0
S0
A1
B1
S1
A2
B2
S2
A3
B3
S3
C1
C2
C3
C4
4-bit binary adder (connection of
FAs)
©सरोज थापा
5
Binary Adder-Subtractor
FA
FA
FA
FA
C0
A0
B0
S0
A1
B1
S1
A2
B2
S2
A3
B3
S3
C1
C2
C3
C4
4-bit adder-subtractor
M
©सरोज थापा
6
Binary Incrementer
C S
x y
HA
C S
x y
HA
C S
x y
HA
C S
x y
HA
S0
S1
S2
S3
C4
1
A0
A1
A2
A3
4-bit Binary Incrementer
©सरोज थापा
Arithmetic Circuit
The basic arithmetic micro operations (addition,
subtraction, increment and decrement) can be
performed in one composite arithmetic circuit
©सरोज थापा 7
A
©सरोज थापा 8
Working
This arithmetic circuit can perform 8 operations among
them some are :-
Addition:-
• When S1 S0 = 0 0, the value of B is applied to the Y
inputs of the adder.
• If Cin = 0, the output D = A + B.
• If Cin =1, output D = A + B + 1.
• Both cases perform the add microoperation with or
without adding the input carry.
©सरोज थापा 9
Subtraction
• When S1 S0 = 0 1, the value of B is applied to the
Y inputs of the adder.
• If Cin = 1, then D = A + B + 1. this produces A plus
the 2’s complement of B, which is equivalent to a
subtraction of A – B.
• when Cin = 0, then D = A + B. this is equivalent to
a subtract with borrow, that is , A – B – 1.
©सरोज थापा 10
Increment
• When S1 S0 = 1 0, the inputs from B are neglected ,
and instead, all 0’s are inserted into the y inputs. The
output becomes D = A + 0 + Cin.
• This gives D = A when Cin = 0 and D = A + 1 when Cin
= 1.
• In the first case we have a direct transfer from the
input A to output D and in the second case, the value
of A is incremented by 1.
©सरोज थापा 11
Decrement
• When S1 S0 = 1 1, all 1’s are inserted into the Y
inputs of the adder to produce the decrement
operation D = A – 1 when Cin = 0. this is because a
number with all 1’s is equal to the 2’s complement
of 1 (the 2’s complement of binary 0001 is 1111).
• Adding number A to the 2’complement of 1
produces F = A + 2’s complement of 1 = A – 1 when
Cin = 1, then D = A – 1 + 1 = A, which causes a direct
transfer from input A to output D.
©सरोज थापा 12
Logic Microoperations
©सरोज थापा 13
• Logic microoperations are bit-wise operations, i.e.,
they work on the individual bits of data.
• It is useful for bit manipulations on binary data.
• Useful for making logical decisions based on the bit
value. There are, in principle, 16 different logic
functions that can be defined over two binary input
variables.
• However, most systems only implement four of
these – AND , OR , XOR and Complement/NOT
Hardware implementation
• Hardware implementation of logic
microoperations requires that logic gates be
inserted be each bit or pair of bits in the
resisters to perform the required logic
operation.
©सरोज थापा 14
©सरोज थापा 15
Shift Micro-Operations
• There are three types of shifts
• Logical shift
• Circular shift
• Arithmetic shift
©सरोज थापा 16
Circular Shift operation
• In a circular shift the serial input is the bit that is
shifted out of the other end of the register.
©सरोज थापा 17
Arithmetic Shift Operation
• An arithmetic shift is meant for signed binary
numbers (integer).
• An arithmetic left shift multiplies a signed number by
two and an arithmetic right shift divides a signed
number by two.
• The main distinction of an arithmetic shift is that it
must keep the sign of the number the same as it
performs the multiplication or division
©सरोज थापा 18
©सरोज थापा 19
An left arithmetic shift operation must be checked for
the overflow
Cont…
©सरोज थापा 20
An overflow flip-flop V can be used to detect an
arithmetic shift-left overflow. V = Rn-1 ⊕ Rn-2
If V = 0, there is no overflow but if V = 1, overflow is
detected
Hardware Implementation of Shift
Microoperations
©सरोज थापा 21
Status Register
• A status register, flag register, or condition code register
(CCR) is a collection of status flag bits for a processor.
• An example is the FLAGS register of the x86 architecture or
flags in a program status word (PSW) register.
• The status register is a hardware register that contains
information about the state of the processor.
• Individual bits are implicitly or explicitly read and/or
written by the machine code instructions executing on the
processor.
• The status register lets an instruction take action on the
outcome of a previous instruction.
• Typically, flags in the status register are modified as effects
of arithmetic and bit manipulation operations.
Status Register
Status register
Error Correction codes
• Hamming code is a liner code that is useful for error detection up to
two immediate bit errors.
• In Hamming code, the source encodes the message by adding
redundant bits in the message. These redundant bits are mostly
inserted and generated at certain positions in the message to
accomplish error detection and correction process.
• Hamming code method is effective on networks where the data
streams are given for the single-bit errors.
• Hamming code not only provides the detection of a bit error but
also helps you to indent bit containing error so that it can be
corrected.
• The ease of use of hamming codes makes it best them suitable for
use in computer memory and single-error correction.
How to Encode a message in
Hamming Code
The process used by the sender to encode the message includes the
following three steps:
1. Calculation of total numbers of redundant bits.
2. Checking the position of the redundant bits.
3. Lastly, calculating the values of these redundant bits.
When the above redundant bits are embedded within the message, it is
sent to the user.
Step 1) Calculation of the total number of redundant bits.
Let assume that the message contains:
n– number of data bits
p – number of redundant bits which are added to it so that np
can indicate at least (n + p + 1) different states.
Here, (n + p) depicts the location of an error in each of (n + p)
bit positions and one extra state indicates no error. As p bits can indicate
2p states, 2p has to at least equal to (n + p + 1).
Cont…
Step 2) Placing the redundant bits in their correct position.
The p redundant bits should be placed at bit positions of
powers of 2. For example, 1, 2, 4, 8, 16, etc. They are referred
to as p1 (at position 1), p2 (at position 2), p3 (at position 4), etc.
Step 3) Calculation of the values of the redundant bit.
• The redundant bits should be parity bits makes the number
of 1s either even or odd.
• The two types of parity are ?
• Total numbers of bits in the message is made even is called
even parity.
• The total number of bits in the message is made odd is
called odd parity.
Cont….
• Here, all the redundant bit, p1, is must calculated as the
parity. It should cover all the bit positions whose binary
representation should include a 1 in the 1st position
excluding the position of p1.
• P1 is the parity bit for every data bits in positions whose
binary representation includes a 1 in the less important
position not including 1 Like (3, 5, 7, 9, …. )
• P2 is the parity bit for every data bits in positions whose
binary representation include 1 in the position 2 from right,
not including 2 Like (3, 6, 7, 10, 11,…)
• P3 is the parity bit for every bit in positions whose binary
representation includes a 1 in the position 3 from right not
include 4 Like (5-7, 12-15,… )
Cont….
Decrypting a Message in Hamming code
• Receiver gets incoming messages which require to
performs recalculations to find and correct errors.
The recalculation process done in the following steps:
• Counting the number of redundant bits.
• Correctly positioning of all the redundant bits.
• Parity check
Step 1) Counting the number of redundant bits
• You can use the same formula for encoding, the number of
redundant bits
2p ? n + p + 1
• Here, the number of data bits and p is the number of
redundant bits.
Cont….
Step 2) Correctly positing all the redundant bits
Here, p is a redundant bit which is located at bit
positions of powers of 2, For example, 1, 2, 4, 8, etc.
Step 3) Parity check
Parity bits need to calculated based on data bits and
the redundant bits.
p1 = parity(1, 3, 5, 7, 9, 11…)
p2 = parity(2, 3, 6, 7, 10, 11… )
p3 = parity(4-7, 12-15, 20-23… )
Conversion from RS FF into JK FF
• Step 1 : For conversion of SR Flip flop to JK Flip flop at first we
have to make combine truth table for SR flip flop and JK Flip
Flop. In bellow see the combine truth table of SR flip flop and
JK Flip Flop.
Accumulator register

More Related Content

Similar to Chapter 9.pdf

Four bit Signed Calculator.pptx
Four bit Signed Calculator.pptxFour bit Signed Calculator.pptx
Four bit Signed Calculator.pptxSUGAMRAJPUT2
 
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdfCS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdfAsst.prof M.Gokilavani
 
Manoch1raw 160512091436
Manoch1raw 160512091436Manoch1raw 160512091436
Manoch1raw 160512091436marangburu42
 
computer architecture organization in Ece
computer architecture organization in Ececomputer architecture organization in Ece
computer architecture organization in EceBayesayohannis
 
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...inventionjournals
 
Comparison of Adders for optimized Exponent Addition circuit in IEEE754 Float...
Comparison of Adders for optimized Exponent Addition circuit in IEEE754 Float...Comparison of Adders for optimized Exponent Addition circuit in IEEE754 Float...
Comparison of Adders for optimized Exponent Addition circuit in IEEE754 Float...IJERD Editor
 
UNIT 4 -Data Representation.pptxfghfghhggh
UNIT 4 -Data Representation.pptxfghfghhgghUNIT 4 -Data Representation.pptxfghfghhggh
UNIT 4 -Data Representation.pptxfghfghhgghKwadjoOwusuAnsahQuar
 
data representation
 data representation data representation
data representationHaroon_007
 
Computer organization prashant odhavani- 160920107003
Computer organization   prashant odhavani- 160920107003Computer organization   prashant odhavani- 160920107003
Computer organization prashant odhavani- 160920107003Prashant odhavani
 
Lecture 2 coal sping12
Lecture 2 coal sping12Lecture 2 coal sping12
Lecture 2 coal sping12Rabia Khalid
 
Unit-8-Computer-Arithmetic.pdf
Unit-8-Computer-Arithmetic.pdfUnit-8-Computer-Arithmetic.pdf
Unit-8-Computer-Arithmetic.pdfGafryMahmoud
 
Floating point arithmetic operations (1)
Floating point arithmetic operations (1)Floating point arithmetic operations (1)
Floating point arithmetic operations (1)cs19club
 
Digital electronics & microprocessor Batu- s y computer engineering- arvind p...
Digital electronics & microprocessor Batu- s y computer engineering- arvind p...Digital electronics & microprocessor Batu- s y computer engineering- arvind p...
Digital electronics & microprocessor Batu- s y computer engineering- arvind p...ARVIND PANDE
 
Unit ii ca--arithmetic
Unit ii ca--arithmeticUnit ii ca--arithmetic
Unit ii ca--arithmeticPraba haran
 
Computer Oraganizaation.pptx
Computer Oraganizaation.pptxComputer Oraganizaation.pptx
Computer Oraganizaation.pptxbmangesh
 
fixed-point-vs-floating-point.ppt
fixed-point-vs-floating-point.pptfixed-point-vs-floating-point.ppt
fixed-point-vs-floating-point.pptRavikumarR77
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operationNikhil Pandit
 
counters and resister presentations.pptx
counters and resister presentations.pptxcounters and resister presentations.pptx
counters and resister presentations.pptxarushika2211
 

Similar to Chapter 9.pdf (20)

Four bit Signed Calculator.pptx
Four bit Signed Calculator.pptxFour bit Signed Calculator.pptx
Four bit Signed Calculator.pptx
 
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdfCS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
 
Manoch1raw 160512091436
Manoch1raw 160512091436Manoch1raw 160512091436
Manoch1raw 160512091436
 
computer architecture organization in Ece
computer architecture organization in Ececomputer architecture organization in Ece
computer architecture organization in Ece
 
Session 4.pptx
Session 4.pptxSession 4.pptx
Session 4.pptx
 
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
 
Comparison of Adders for optimized Exponent Addition circuit in IEEE754 Float...
Comparison of Adders for optimized Exponent Addition circuit in IEEE754 Float...Comparison of Adders for optimized Exponent Addition circuit in IEEE754 Float...
Comparison of Adders for optimized Exponent Addition circuit in IEEE754 Float...
 
UNIT 4 -Data Representation.pptxfghfghhggh
UNIT 4 -Data Representation.pptxfghfghhgghUNIT 4 -Data Representation.pptxfghfghhggh
UNIT 4 -Data Representation.pptxfghfghhggh
 
data representation
 data representation data representation
data representation
 
Computer organization prashant odhavani- 160920107003
Computer organization   prashant odhavani- 160920107003Computer organization   prashant odhavani- 160920107003
Computer organization prashant odhavani- 160920107003
 
Lecture 2 coal sping12
Lecture 2 coal sping12Lecture 2 coal sping12
Lecture 2 coal sping12
 
Unit-8-Computer-Arithmetic.pdf
Unit-8-Computer-Arithmetic.pdfUnit-8-Computer-Arithmetic.pdf
Unit-8-Computer-Arithmetic.pdf
 
Floating point arithmetic operations (1)
Floating point arithmetic operations (1)Floating point arithmetic operations (1)
Floating point arithmetic operations (1)
 
Digital electronics & microprocessor Batu- s y computer engineering- arvind p...
Digital electronics & microprocessor Batu- s y computer engineering- arvind p...Digital electronics & microprocessor Batu- s y computer engineering- arvind p...
Digital electronics & microprocessor Batu- s y computer engineering- arvind p...
 
Unit ii ca--arithmetic
Unit ii ca--arithmeticUnit ii ca--arithmetic
Unit ii ca--arithmetic
 
Computer Oraganizaation.pptx
Computer Oraganizaation.pptxComputer Oraganizaation.pptx
Computer Oraganizaation.pptx
 
fixed-point-vs-floating-point.ppt
fixed-point-vs-floating-point.pptfixed-point-vs-floating-point.ppt
fixed-point-vs-floating-point.ppt
 
CSO PPT.pptx
CSO PPT.pptxCSO PPT.pptx
CSO PPT.pptx
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operation
 
counters and resister presentations.pptx
counters and resister presentations.pptxcounters and resister presentations.pptx
counters and resister presentations.pptx
 

Recently uploaded

Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdfKamal Acharya
 
Danfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdfDanfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdfNurvisNavarroSanchez
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectRased Khan
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptssuser9bd3ba
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdfAhmedHussein950959
 
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...Amil baba
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxViniHema
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdfKamal Acharya
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfAbrahamGadissa
 
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringC Sai Kiran
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdfKamal Acharya
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerapareshmondalnita
 
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfA CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfKamal Acharya
 
Toll tax management system project report..pdf
Toll tax management system project report..pdfToll tax management system project report..pdf
Toll tax management system project report..pdfKamal Acharya
 
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringC Sai Kiran
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfPipe Restoration Solutions
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdfPratik Pawar
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industriesMuhammadTufail242431
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationRobbie Edward Sayers
 

Recently uploaded (20)

Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdf
 
Danfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdfDanfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdf
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker project
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
 
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answer
 
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfA CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
 
Toll tax management system project report..pdf
Toll tax management system project report..pdfToll tax management system project report..pdf
Toll tax management system project report..pdf
 
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 

Chapter 9.pdf

  • 2.
  • 3. Arithmetic Microperations • Arithmetic Microoperations perform arithmetic operation on numeric data stored in registers. The basic arithmetic micro operations are:- • Addition • Subtraction • Increment • Decrement ©सरोज थापा 3
  • 4. 4 Binary Adder FA FA FA FA C0 A0 B0 S0 A1 B1 S1 A2 B2 S2 A3 B3 S3 C1 C2 C3 C4 4-bit binary adder (connection of FAs) ©सरोज थापा
  • 6. 6 Binary Incrementer C S x y HA C S x y HA C S x y HA C S x y HA S0 S1 S2 S3 C4 1 A0 A1 A2 A3 4-bit Binary Incrementer ©सरोज थापा
  • 7. Arithmetic Circuit The basic arithmetic micro operations (addition, subtraction, increment and decrement) can be performed in one composite arithmetic circuit ©सरोज थापा 7
  • 9. Working This arithmetic circuit can perform 8 operations among them some are :- Addition:- • When S1 S0 = 0 0, the value of B is applied to the Y inputs of the adder. • If Cin = 0, the output D = A + B. • If Cin =1, output D = A + B + 1. • Both cases perform the add microoperation with or without adding the input carry. ©सरोज थापा 9
  • 10. Subtraction • When S1 S0 = 0 1, the value of B is applied to the Y inputs of the adder. • If Cin = 1, then D = A + B + 1. this produces A plus the 2’s complement of B, which is equivalent to a subtraction of A – B. • when Cin = 0, then D = A + B. this is equivalent to a subtract with borrow, that is , A – B – 1. ©सरोज थापा 10
  • 11. Increment • When S1 S0 = 1 0, the inputs from B are neglected , and instead, all 0’s are inserted into the y inputs. The output becomes D = A + 0 + Cin. • This gives D = A when Cin = 0 and D = A + 1 when Cin = 1. • In the first case we have a direct transfer from the input A to output D and in the second case, the value of A is incremented by 1. ©सरोज थापा 11
  • 12. Decrement • When S1 S0 = 1 1, all 1’s are inserted into the Y inputs of the adder to produce the decrement operation D = A – 1 when Cin = 0. this is because a number with all 1’s is equal to the 2’s complement of 1 (the 2’s complement of binary 0001 is 1111). • Adding number A to the 2’complement of 1 produces F = A + 2’s complement of 1 = A – 1 when Cin = 1, then D = A – 1 + 1 = A, which causes a direct transfer from input A to output D. ©सरोज थापा 12
  • 13. Logic Microoperations ©सरोज थापा 13 • Logic microoperations are bit-wise operations, i.e., they work on the individual bits of data. • It is useful for bit manipulations on binary data. • Useful for making logical decisions based on the bit value. There are, in principle, 16 different logic functions that can be defined over two binary input variables. • However, most systems only implement four of these – AND , OR , XOR and Complement/NOT
  • 14. Hardware implementation • Hardware implementation of logic microoperations requires that logic gates be inserted be each bit or pair of bits in the resisters to perform the required logic operation. ©सरोज थापा 14
  • 16. Shift Micro-Operations • There are three types of shifts • Logical shift • Circular shift • Arithmetic shift ©सरोज थापा 16
  • 17. Circular Shift operation • In a circular shift the serial input is the bit that is shifted out of the other end of the register. ©सरोज थापा 17
  • 18. Arithmetic Shift Operation • An arithmetic shift is meant for signed binary numbers (integer). • An arithmetic left shift multiplies a signed number by two and an arithmetic right shift divides a signed number by two. • The main distinction of an arithmetic shift is that it must keep the sign of the number the same as it performs the multiplication or division ©सरोज थापा 18
  • 19. ©सरोज थापा 19 An left arithmetic shift operation must be checked for the overflow
  • 20. Cont… ©सरोज थापा 20 An overflow flip-flop V can be used to detect an arithmetic shift-left overflow. V = Rn-1 ⊕ Rn-2 If V = 0, there is no overflow but if V = 1, overflow is detected
  • 21. Hardware Implementation of Shift Microoperations ©सरोज थापा 21
  • 22. Status Register • A status register, flag register, or condition code register (CCR) is a collection of status flag bits for a processor. • An example is the FLAGS register of the x86 architecture or flags in a program status word (PSW) register. • The status register is a hardware register that contains information about the state of the processor. • Individual bits are implicitly or explicitly read and/or written by the machine code instructions executing on the processor. • The status register lets an instruction take action on the outcome of a previous instruction. • Typically, flags in the status register are modified as effects of arithmetic and bit manipulation operations.
  • 25. Error Correction codes • Hamming code is a liner code that is useful for error detection up to two immediate bit errors. • In Hamming code, the source encodes the message by adding redundant bits in the message. These redundant bits are mostly inserted and generated at certain positions in the message to accomplish error detection and correction process. • Hamming code method is effective on networks where the data streams are given for the single-bit errors. • Hamming code not only provides the detection of a bit error but also helps you to indent bit containing error so that it can be corrected. • The ease of use of hamming codes makes it best them suitable for use in computer memory and single-error correction.
  • 26. How to Encode a message in Hamming Code The process used by the sender to encode the message includes the following three steps: 1. Calculation of total numbers of redundant bits. 2. Checking the position of the redundant bits. 3. Lastly, calculating the values of these redundant bits. When the above redundant bits are embedded within the message, it is sent to the user. Step 1) Calculation of the total number of redundant bits. Let assume that the message contains: n– number of data bits p – number of redundant bits which are added to it so that np can indicate at least (n + p + 1) different states. Here, (n + p) depicts the location of an error in each of (n + p) bit positions and one extra state indicates no error. As p bits can indicate 2p states, 2p has to at least equal to (n + p + 1).
  • 27. Cont… Step 2) Placing the redundant bits in their correct position. The p redundant bits should be placed at bit positions of powers of 2. For example, 1, 2, 4, 8, 16, etc. They are referred to as p1 (at position 1), p2 (at position 2), p3 (at position 4), etc. Step 3) Calculation of the values of the redundant bit. • The redundant bits should be parity bits makes the number of 1s either even or odd. • The two types of parity are ? • Total numbers of bits in the message is made even is called even parity. • The total number of bits in the message is made odd is called odd parity.
  • 28. Cont…. • Here, all the redundant bit, p1, is must calculated as the parity. It should cover all the bit positions whose binary representation should include a 1 in the 1st position excluding the position of p1. • P1 is the parity bit for every data bits in positions whose binary representation includes a 1 in the less important position not including 1 Like (3, 5, 7, 9, …. ) • P2 is the parity bit for every data bits in positions whose binary representation include 1 in the position 2 from right, not including 2 Like (3, 6, 7, 10, 11,…) • P3 is the parity bit for every bit in positions whose binary representation includes a 1 in the position 3 from right not include 4 Like (5-7, 12-15,… )
  • 29. Cont…. Decrypting a Message in Hamming code • Receiver gets incoming messages which require to performs recalculations to find and correct errors. The recalculation process done in the following steps: • Counting the number of redundant bits. • Correctly positioning of all the redundant bits. • Parity check Step 1) Counting the number of redundant bits • You can use the same formula for encoding, the number of redundant bits 2p ? n + p + 1 • Here, the number of data bits and p is the number of redundant bits.
  • 30. Cont…. Step 2) Correctly positing all the redundant bits Here, p is a redundant bit which is located at bit positions of powers of 2, For example, 1, 2, 4, 8, etc. Step 3) Parity check Parity bits need to calculated based on data bits and the redundant bits. p1 = parity(1, 3, 5, 7, 9, 11…) p2 = parity(2, 3, 6, 7, 10, 11… ) p3 = parity(4-7, 12-15, 20-23… )
  • 31. Conversion from RS FF into JK FF • Step 1 : For conversion of SR Flip flop to JK Flip flop at first we have to make combine truth table for SR flip flop and JK Flip Flop. In bellow see the combine truth table of SR flip flop and JK Flip Flop.