SlideShare a Scribd company logo
1 of 32
Download to read offline
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

power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 

Recently uploaded (20)

★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 

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.