DOC-20240924-WA0023
DOC-20240924-WA0023
DOC-20240924-WA0023
Assignment 1
DECIMAL OCTAL
BINARY HEXADECIMAL
In the example above, 125(base10) is divided by 2 for converting it to base2 number until the quotient is less than
the divisor i.e. 2. Thus in the example provided above, 125(base10) = 111101(base2)
DECIMAL TO OCTAL CONVERSION
a(base10)=b(base8)
Take the number of be converted and divide it by base of the system to be converted to i.e. 8.
Arrange all the remainder obtained in reverse order.
The sequence obtained is the octal equivalent of the taken decimal number.
In the example above, 125(base10) is divided by 8 for converting it to base8 number until the quotient is less than
the divisor i.e. 8. Thus in the example provided above, 125(base10) = 175(base8)
NOTE :- It can be observed that each digit of the output number is less than 8.
DECIMAL TO HEXADECIMAL CONVERSION
a(base10)=b(base16)
Take the number of be converted and divide it by base of the system to be converted to i.e. 16.
Arrange all the remainder obtained in reverse order.
The sequence obtained is the octal equivalent of the taken decimal number.
In the example above, 125(base10) is divided by 16 for converting it to base16 number until the quotient is less
than the divisor i.e. 16. Thus in the example provided above, 125(base10) = 7D(base16)
BINARY TO DECIMAL CONVERSION
a(base2)=b(base10)
To convert a binary number to decimal, 2 is raised to the power of (n-1) for each bit where n is the position of the
bit from right hand side.
Then the outcome of 2 raised to (n-1) for each bit is multiplied with their respective bit values and all the number
are then added to get the final decimal number.
In the example above, 11101(base2), 2 is raised to (n-1) for each bit where n is the position of the bit from right
hand side.
Then the following operation is performed:-
1*16+1*8+1*4+0*2+1*1=29
BINARY TO OCTAL CONVERSION
a(base2)=b(base8)
To convert from binary to octal, we can first of all convert the binary number to decimal and then convert it to
octal.
However, there is another quick method for converting binary to octal. For that we need to divide the number
into group of three bits each, if number of bits in the number is not a multiple of 3, we can proceed after adding
sufficient number of zero bits at the beginning.
After making the groups we just need to take the values written above bit “1” and then add the numbers
obtained.
Then the number obtained from each group are written together to get the final octal number.
BINARY TO HEXADECIMAL CONVERSION
a(base2)=b(base16)
To convert from binary to hexadecimal, we can first of all convert the binary number to decimal and then convert
it to hexadecimal.
However, there is another quick method for converting binary to hexadecimal. For that we need to divide the
number into group of four bits each, if number of bits in the number is not a multiple of 4, we can proceed after
adding sufficient number of zero bits at the beginning.
After making the groups we just need to take the values written above bit “1” and then add the numbers
obtained.
Then the number obtained from each group are written together to get the final hexadecimal number.
OCTAL TO DECIMAL CONVERSION
a(base8)=b(base10)
To convert a octal number to decimal, 8 is raised to the power of (n-1) for each bit where n is the position of the
bit from right hand side.
Then the outcome of 8 raised to (n-1) for each bit is multiplied with their respective bit values and all the number
are then added to get the final decimal number.
In the example above, 125(base8), 8 is raised to (n-1) for each bit where n is the position of the bit from right hand
side.
Then the following operation is performed:-
1*64+2*8+5*1=85
OCTAL TO BINARY CONVERSION
a(base8)=b(base2)
4 2 1 Value
0 0 0 0
To convert from octal to binary, we can first of all convert the octal
number to decimal and then convert it to binary. 0 0 1 1
However, there is another quick method for converting binary to
hexadecimal. For that we need to make an octal table as shown.
0 1 0 2
Then the table is used to match the binary equivalent of each octal
number.
For example 125(base8)=001010101(base2), where 001 is binary of 0 1 1 3
octal 1, 010 is binary of octal 2, 101 is binary of octal 5.
1 0 0 4
1 0 1 5
1 1 0 6
1 1 1 7
OCTAL TO HEXADECIMAL CONVERSION
a(base8)=b(base16)
To convert from octal to hexadecimal, we can first of all convert the octal number to decimal and then convert
it to hexadecimal.
However, there is another quick method for converting octal to hexadecimal. For that we need to divide the
number into group of four bits each, if number of bits in the number is not a multiple of 4, we can proceed
after adding sufficient number of zero bits at the beginning.
After making the groups we just need to take the values written above bit “1” and then add the numbers
obtained.
Then the number obtained from each group are written together to get the final hexadecimal number.
HEXADECIMAL TO DECIMAL CONVERSION
a(base16)=b(base10)
To convert a hexadecimal number to decimal, 16 is raised to the power of (n-1) for each bit where n is the position
of the bit from right hand side.
Then the outcome of 16 raised to (n-1) for each bit is multiplied with their respective bit values and all the number
are then added to get the final decimal number.
In the example above, 125(base16), 16 is raised to (n-1) for each bit where n is the position of the bit from right
hand side.
Then the following operation is performed:-
2*256+D*16+5*1=512+13*16+5=727
HEXADECIMAL TO BINARY CONVERSION
a(base16)=b(base2)
To convert from hexadecimal to binary, we can first of all convert the hexadecimal number to decimal and
then convert it to binary.
To convert from hexadecimal to octal, we can first of all convert the hexadecimal number to decimal and then
convert it to octal.
TRUTH TABLE
NOT GATE DIAGRAM
A X
0 1
A Ā
1 0
AND GATE
AND gate is a logic circuit having two or more inputs and one output.
The AND gate performs logical multiplication i.e. AND function.
The output of an AND gate is HIGH only when all of its inputs are in the HIGH state. In all other cases, the output
is LOW. For AND gate, Y = A.B
If both switches are closed (logic ‘1’) then only lamp is ON (logic ‘1’). If any one or both switches are open (logic’0’)
then lamp will be OFF (logic ‘0’). The AND gate produces a logic 1, if and only if all the inputs are at logic 1.
Boolean Expression: If A and B are two inputs, the output is X=A.B
TRUTH TABLE
AND GATE DIAGRAM
A B A.B
A 0 0 0
A.B
0 1 0
B
1 0 0
1 1 1
OR GATE
An OR gate is a logic circuit with two or more inputs and one output.
The OR gate performs logical addition i.e. OR function.
The output of an OR gate is HIGH only when all of its inputs are in the HIGH state. In all other cases, the output is
LOW.
Boolean Expression: If A and B are the inputs, then the output will be X=A+B
TRUTH TABLE
OR GATE DIAGRAM
A B A+B
A 0 0 0
A+B
0 1 1
B
1 0 1
1 1 1
NAND GATE
TRUTH TABLE
NAND GATE DIAGRAM
A B (A.B)(bar)
A 0 0 1
(A.B)(bar)
0 1 1
B
1 0 1
1 1 0
NOR GATE
TRUTH TABLE
NOR GATE DIAGRAM
A B (A+B)(bar)
A 0 0 1
(A+B)(bar)
0 1 0
B
1 0 0
1 1 0
XOR (Exclusive OR) GATE
Exclusive OR gate is basically designed to exclude the condition of standard OR gate so as to generate real
binary addition.
An XOR gate is a two inputs and one output logic circuit
The output of an XOR gate is at logic ‘1’ when the inputs are dissimilar and at logic ‘0’ when the inputs are similar
The output of XOR is in logic ‘1’, when one and only one of two inputs are at logic ‘1’. Similarly, the output of XOR
is at logic ‘0’, when both the inputs are at logic ‘0’ or both inputs are at logic ‘1’.
XOR gate generates logic ‘1’ only when inputs are not equal, that is why it is also known as inequality detector
gate.
Boolean Expression: If A and B are the inputs, then the output will be X=A.B(bar)+A(bar).B
TRUTH TABLE
XOR GATE DIAGRAM
A B A.B(bar)+A(bar).B
A 0 0 0
A.B(bar)+A(bar).B
B 0 1 1
1 0 1
1 1 0
XNOR GATE
XNOR is obtained by the combination of NOT and XOR gates.
XNOR gate is a two inputs and one output XOR gate with active low output.
The output of an XNOR gate is at logic ‘1’ when the inputs are similar and at logic ‘0’ when the inputs are
dissimilar.
As XNOR gate generates logic ‘1’ only when both the inputs are equal, hence this gate is also known as equality
detector gate.
Boolean Expression: If A and B are the inputs, then the output will be X=(A.B(bar)+A(bar).B)(bar)
A B (A.B(bar)+A(bar).B)(bar)
A 0 0 1
(A.B(bar)+A(bar).B)(bar)
B 0 1 0
1 0 0
1 1 1
AOI Gate
The figure below indicates the special arrangement of three basic logic gates, which is popularly known as AOI
(AND-OR-Invert) gate. It is used in many applications of combinational systems
Boolean Expression:- f=(A.B+C.D)(bar),
F=f(bar)=(A.B+C.D)(bar)(bar)=A.B+C.D
A.B
(A.B+C.D)(bar)
C.D
THANK
YOU