Professional Documents
Culture Documents
1 Contents
2 Encoder and decoder................................................................................................................2
2.1 Decoder..............................................................................................................................2
1
2.1.1 types of decoders...........................................................................................2
2.2 Encoder..............................................................................................................................4
2.2.1 Priority Encoder.............................................................................................4
2.3 Comparison Chart between encoder and decoder.............................................................4
3 Signed number..........................................................................................................................5
3.1 Introduction........................................................................................................................5
3.2 Sign-Magnitude form.........................................................................................................5
3.3 1’s complement form.........................................................................................................5
3.3.1 Additions by 1’s Complement.......................................................................5
3.3.2 Subtractions by 1’s Complement:..................................................................6
3.4 2’s complement form.........................................................................................................6
3.4.1 Additions by 2’s Complement.......................................................................7
3.4.2 Subtractions by 2’s Complement...................................................................7
3.5 Offset binary......................................................................................................................8
4 Addition and subtraction..........................................................................................................8
4.1 introduction........................................................................................................................8
4.2 Binary Addition.................................................................................................................8
4.3 Binary Subtraction.............................................................................................................9
5 Flip-flops................................................................................................................................10
5.1 Introduction......................................................................................................................10
5.2 Types of flip-flops...........................................................................................................10
5.2.1 SR Flip Flop.................................................................................................10
5.2.2 JK Flip Flop.................................................................................................11
5.2.3 D Flip Flop...................................................................................................11
5.2.4 T Flip Flop...................................................................................................12
5.3 Timing considerations......................................................................................................12
6 Registers.................................................................................................................................13
6.1 Introduction......................................................................................................................13
6.2 Table of most common regestors.....................................................................................13
6.3 Shift registers...................................................................................................................14
7 Application examples.............................................................................................................15
7.1 Applications of the Encoder and Decoder.......................................................................15
7.2 Applications of flip-flops.................................................................................................15
7.3 Applications of Registers.................................................................................................16
8 Conclusion..............................................................................................................................16
2
9 References..............................................................................................................................17
truth table
circuit
3
4. Instruction decoder, an electronic circuit that converts computer instructions into CPU
control signals
5. Quadrature decoder, converts signals from an incremental encoder into counter control
signals
6. Video decoder, converts base-band analog video to digital form
2.2 Encoder
An encoder may be a combinatory circuit that converts binary info within the type of a 2N input
lines into N output lines, that represent N bit code for the input. for easy encoders, it's assumed
that just one input line is active at a time
the Priority Encoder solves the problems by allocating a priority level to each input. The priority
encoders output corresponds to the currently active input which has the highest priority. So when
an input with a higher priority is present, all other inputs with a lower priority will be ignored.
The priority encoder comes in many different forms with an example of an 8-input priority
encoder along with its truth table shown below
3 Signed number
3.1 Introduction
ince, 1’s complement of range variety} is obtained by inverting every little bit of given number.
So, we have a tendency to represent positive numbers in binary kind and negative numbers in 1’s
complement kind. there's further bit for sign illustration. If price of sign bit is zero, then variety is
positive and you'll directly represent it in straightforward binary kind, however if price of sign
bit one, then variety is negative and you have got to require 1’s complement of given
binary variety. you'll get negative variety by 1’s complement of a positive variety and
positive variety by victimization 1’s complement of a negative variety. Therefore, during
this illustration, zero (0) will have 2 illustration, that’s why 1’s complement kind is
additionally ambiguous kind. The vary of 1’s complement kind is from (2(n-1)-1) to (2(n-1)-1)
5
3.3.1 Additions by 1’s Complement
Case-1: Addition of positive and negative number when positive number has greater
magnitude:
When positive number has greater magnitude, then take simply 1’s complement of
negative number and the end-around carry of the sum is added to the least significant
bit (LSB)
Case-2: Addition of positive and negative number when negative number has greater
magnitude:
When the negative number has greater magnitude, then take 1’s complement of
negative number and add with given positive number. Since there will not be any end-
around carry bit, so take 1’s complement of the result and this result will be negative
Case-3: Addition of two negative numbers:
You need to take 1’s complement for both numbers, then add these 1’s complement of
numbers. Since there will always be end-around carry bit, so add this again to the MSB
of result. Now, take 1’s complement also of previous result, so this will be negative
number.
Example of case 1
Add 1110 and -1101.
So, take 1’s complement of 1101, which will be 0010, then add with given number. So,
1110+0010=1 0000 , then add this carry bit to the LSB, 0000+1=0001 , which is the
answer.
3.3.2 Subtractions by 1’s Complement:
The algorithm to subtract two binary number using 1’s complement is explained as following
below:
6
3.4 2’s complement form
Two’s Complement or 2’s Complement because it is additionally termed, is
another methodology just like the previous sign-magnitude and one’s complement kind, that we
will use to represent negative binary numbers in an exceedingly signed binary mathematical
notation. In two’s complement, the positive numbers ar precisely the same as before
for unsigned binary numbers. A negative variety, however, is described by a
binary variety, that once supplementary to its corresponding positive equivalent ends up in zero.
The main advantage of two’s complement over the previous one’s complement is that there's no
double-zero downside and it's a great deal easier to come up with the two’s complement of a
signed binary variety. Therefore, arithmetic operations ar comparatively easier to
perform once the numbers ar described within the two’s complement format
Case-1: Addition of positive and negative number when positive number has
greater magnitude
When positive number has greater magnitude, then take simply 2’s complement of negative
number and carry bit 1 is dropped and this result will be positive number
Case-2: Addition of positive and negative number when negative number has
greater magnitude
When the negative number has greater magnitude, then take 2’s complement of negative number
and add with given positive number. Since there will not be any end-around carry bit, so take 2’s
complement of the result and this result will be negative
Case-3: Addition of two negative numbers
You need to take 2’s complement for both numbers, then add these 2’s complement of numbers.
Since there will always be end-around carry bit, so it is dropped. Now, take 2’s complement also
of previous result, so this will be negative number.
Example for case 1
Add 1110 and -1101.
So, take 2’s complement of 1101, which will be 0011, then add with given number. So,
1110+0011=1 0001, and carry bit 1 is dropped and this result will be positive number, i.e.,
+0001.
7
If the result of above addition has carry bit 1, then it is dropped and this result will be positive
number.
If there is no carry bit 1, then take 2’s complement of the result which will be negative
Example (When Carry bit 1): Evaluate 10101 - 00101
According to above algorithm, take 2’s complement of subtrahend 00101, which will be 11011,
then add both of these. So, 10101 + 11011 =1 10000. Since, there is carry bit 1, so dropped this
carry bit 1, and take this result will be 10000 will be positive number
The addition and subtraction of the binary system of numeration area unit almost like that of the
decimal system of numeration. solely|the sole} distinction is that the decimal system of
numeration consists the digit from 0-9 and their base is ten whereas the binary system of
numeration consists only 2 digits (0 and 1) that build their operation easier. The addition and
subtraction of binary variety systems area unit explained below in details
For understanding, the binary addition first considers the addition of two decimal numbers as
shown below.
When we added the one’s column of the binary digit (i.e., 7+4) we get the number which is
greater than the base of the decimal number (the base of the number is 10 and the sum of the digit
is 11). Now add the tens column of the binary digit whose sum is equal to 9, and hence less than
the base. So there is no carry in the ten’s column of the binary digit.
8
4.2 Binary Addition
The binary number system uses only two digits 0 and 1 due to which their addition is simple.
There are four basic operations for binary addition, as mentioned above.
0+0=0
0+1=1
1+0=1
1+1=10
The above first three equations are very identical to the binary digit number. The column by
column addition of binary is applied below in details. Let us consider the addition of 11101 and
11011.
1 + 1 = 10 = 0 with a carry of 1.
1 +1 +1 = 11
Note carefully that 10 + 1 = 11, which is equivalent to two + one = three (the next binary number
after 10)
0–0=0
1–0=1
1–1=0
10 – 1 = 1
The above first three operations are easy to understand as they are identical to decimal
subtraction. The fourth operation can be understood with the logic two minus one is one.
For a binary number with two or more digits, the subtraction is carried out column by column as
in decimal subtraction. Also, sometimes one has to borrow from the next higher column.
Consider the following example.
0–0=0
1-1=0
5 Flip-flops
5.1 Introduction
A flip flop is an electronic circuit with two stable states that can be used to store binary
data The hold on information may be modified by applying variable inputs. Flip-flops and
10
latches area unit elementary building blocks of digital physics systems employed in computers,
communications, and plenty of alternative kinds of systems. Flip-flops and latches area unit used
as information storage components. it's the fundamental storage component in serial logic. But
first, let’s clarify the distinction between a latch and a flip-flop
11
5.2.3 D Flip Flop
D Flip-flops are used as a part of memory storage elements and data processors as well. D flip-
flop can be built using NAND gate or with NOR gate. Due to its versatility they are available as
IC packages. The major applications of D flip-flop are to introduce delay in timing circuit, as a
buffer, sampling data at specific intervals. D flip-flop is simpler in terms of wiring connection
compared to JK flip-flop. Here we are using NAND gates for demonstrating the D flip flop
The T flip-flop, also called the toggle flip-flop, is frequently used in building counters.
Most CPLDs and FPGAs can be programmed to implement T flip-flops. The T flip-flop
has a T input and a clock input. When T 1 the flip-flop changes
state after the active edge of the clock. When T 0, no state change occurs. The next-
state table and characteristic equation for the T flip-flop are given
The characteristic equation states that the next state of the flip-flop (Q) will be 1 if the
present state (Q) is 1 and T 0 or the present state is 0 and T 1.
6 Registers
6.1 Introduction
Registers are a sort of storage device wont to quickly settle for, store, and
transfer information and directions that are being employed at once by the C.P.U.. The
registers utilized by the C.P.U. are usually termed as Processor registers.
13
Instruction IR 16 Holds instruction code
register
Program PC 12 Holds address of the instruction
counter
Temporary TR 16 Holds temporary data
register
Input register INPR 8 Carries input character
14
7 Application examples
These are the various types of flip-flops being used in digital electronic circuits and the
applications of Flip-flops are as specified below.
Counters
Frequency Dividers
Shift Registers
Storage Registers
Bounce elimination switch
Data storage
15
Data transfer
Latch
Registers
Memory
8 Conclusion
After reading this report we will be able to know what is encoder and decoder and their types
,applications ,circuits and truth table with the deference between both of them
Also the three main types of signed numbers with the ways ,examples and roles of it’s additions
and subtractions
Binary addition and subtractions number have a deferent functions from the decimals so we
explain it with the examples
16
Flip-flops is a unit that use to save and storage the information in different ways each type of it
save by specific way we briefly define all type of it with their truth table and circuit also
applications of flip-flops
Registers or C P U which consist of many smaller parts to store information and make the work
easier table of common registers and the shift register’s explanation
9 References
Main references
Book name:- Fundamentals Of Digital Logic with VHDL Design chapters :
5.3 signed numbers
6.3 encoders
7.8 registers
book name :- Fundamentals of Logic Design, Sixth Edition
Charles H. Roth, Jr. and Larry L. Kinney ::
Unit 1 introduction number systems and conversion 1.3 binary arithmetic
Unit 11 latches and flip-flops
Other references
1. https://electronicscoach.com/difference-between-encoder-and-decoder.html
2. http://www.ee.ncu.edu.tw/~jimmy/courses/DCS04/chap_4.pdf
3. https://www.geeksforgeeks.org/encoders-and-decoders-in-digital-logic/
4. https://www.electronics-tutorials.ws/combination/comb_4.html
5. https://en.wikipedia.org/wiki/Decoder
6. https://www.tutorialspoint.com/unsigned-and-signed-binary-numbers
7. https://www.electronics-tutorials.ws/binary/signed-binary-numbers.html
8. https://www.tutorialspoint.com/one-s-complement
9. https://www.electronicsforu.com/resources/learn-electronics/flip-flop-rs-jk-t-d
10. https://en.wikipedia.org/wiki/Flip-flop_(electronics)#Timing_considerations
11. https://www.javatpoint.com/computer-registers
17