3 GOAT Computer Awareness PDF - Number System and Digital Logics
3 GOAT Computer Awareness PDF - Number System and Digital Logics
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
A digital system can understand positional number system only where there are a few symbols called
digits and these symbols represent different values depending on the position they occupy in the
number.
1. The digit
2. The position of the digit in the number
3. The base of the number system (where base is defined as the totalnumber of digits available in
The number system that we use in our day-to-day life is decimal number system. It consists of 10 digits
from 0 to 9. These digits can be used to represent any numeric value. It is also known as Base 10
This system is very efficient for computers, but not for humans. It contains only two unique digits 0’sand
1’s. It is also known as Base 2 system. A string, which has any combination of these two digits (0 and 1
are called a bit) is called binary number. The computer always calculates input in binary form. e.x.
101112
Example
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
(1 x 20))10
● Each position in an octal number represents a 0 power of the base (8). Example: 8 0
Example
82) + (7 x 81) + (1
x 80))10
1)10
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
● Letters represents numbers starting from 10. A = 10, B = 11, C = 12, D =13, E = 14, F = 15.
● Each position in a hexadecimal number represents a 0 power of the base (16). Example 16 0.
● Last position in a hexadecimal number represents an x power of the base
Example:
Hexadecimal Number: 19FDE16
NUMBER
x 162) + (D x 161)
+ (E x 160))10
208 + 14)10
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
There are many methods or techniques which can be used to convert numbers from one base to
another.
Steps
● Step 1 - Divide the decimal number to be converted by the value of the desired base.
● Step 2 - Get the remainder from Step 1 as the rightmost digit (least significant digit) of new base
number.
● Step 3 - Divide the quotient of the previous divide by the new base.
● Step 4 - Record the remainder from Step 3 as the next digit (to the left)
of the new base number.
Until the quotient becomes zero, Step 3 and Step 4 must be repeated.
The last remainder thus obtained will be the Most Significant Digit (MSD) of the new base number.
Example:
1 31 / 2 15 1
2 15 / 2 7 1
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
3 7/2 3 1
4 3/2 1 1
5 1/2 0 1
The remainders have to be arranged in the reverse order so that the first remainder becomes the Least
Significant Digit (LSD) and the last remainder becomes the Most Significant Digit (MSD). Decimal
Number: 3110 = Binary Number: 111112.
Steps
● Determine the positional value of each digit.
● Multiply the obtained column values (in Step 1) by the digits in the corresponding columns.
● Sum the products calculated in Step 2. The total is the equivalent value in decimal.
Example
Binary Number: 111012
22) + (0 x 21) +
(1 x 20))10
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
Steps
● Convert the original number to a decimal number (base 10).
3 258 2110
1 21 / 2 10 1
2 10 / 2 5 0
3 5/2 2 1
4 2/2 1 0
5 1/2 0 1
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
BINARY TO OCTAL
Steps
● Divide the binary digits into groups of three (starting from the right).
Octal Equivalent
Step 2 101012 28 58
OCTAL TO BINARY
Steps
● Convert each octal digit to a 3 digit binary number (the octal digits may be treated as decimal for
this conversion).
● Combine all the resulting binary groups (of 3 digits each) into a single binary number.
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
BINARY TO HEXADECIMAL
Steps
● Divide the binary digits into groups of four (starting from the right).
● Convert each group of four binary digits to one hexadecimal symbol.
Example
Binary Number: 101012
NUMBER
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
HEXADECIMAL TO BINARY
Steps:
● Convert each hexadecimal digit to a 4 digit binary number (the hexadecimal digits may be treated
Example
Hexadecimal Number: 1516
BINARY CODES
In digital, when numbers, letters or words are represented by a specific group of symbols, it is said that
the number, letter or word is being encoded. These groups of symbols, numbers and letters are then
said to be called code. The digital data is represented, stored and transmitted as group of binary bits.
ADVANTAGES
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
1. Weighted Codes: - Weighted binary codes are those binary codes which obey the positional
weight principle. Each position of the number represents a specific weight. Several systems of the
codes are used to express the decimal digits 0 through 9. In these codes each decimal digit is
represented by a group of four bits.
2.
For example the decimal number 24 is taken. The MSB and the LSB both are represented in
binary form. Hence, 0010 comes from the MSB bit
3. Excess-3 code: - The Excess-3 code is also called XS-3 code. It is a non-weighted code used to
express decimal numbers. The Excess-3 code words are derived from the 8421 BCD code words
adding (0011)2 or (3)10 to each code word in 8421. The excess-3 codes are obtained as follows:
8 4 2 1 BCD + 0011
0 0 0 0 0 0 0 1 1
1 0 0 0 1 0 1 0 0
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
2 0 0 1 0 0 1 0 1
3 0 0 1 1 0 1 1 0
4 0 1 0 0 0 1 1 1
5 0 1 0 1 1 0 0 0
6 0 1 1 0 1 0 0 1
7 0 1 1 1 1 0 1 0
8 1 0 0 0 1 0 1 1
9 1 0 0 1 1 1 0 0
4. Gray Code: - They are non-weighted codes but not arithmetic code. That means there are no
specific weights assigned to the bit position. It has a very special feature that only one bit will
change each time the decimal number is incremented. As only one bit changes at a time, the gray
code is called a unit distance code. The gray code is a cyclic code which cannot be used for
arithmetic operation.
8 4 2 1
0 0 0 0 0 0 0 0 0
1 0 0 0 1 0 0 0 1
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
2 0 0 1 0 0 0 1 1
3 0 0 1 1 0 0 1 0
4 0 1 0 0 0 1 1 0
5 0 1 0 1 0 1 1 1
6 0 1 1 0 0 1 0 1
7 0 1 1 1 0 1 0 0
8 1 0 0 0 1 1 0 0
9 1 0 0 1 1 1 0 1
5. Binary Coded Decimal (BCD) code: - In this code each decimal digit is represented by a 4-bit
binary number. BCD is a way to express each of the decimal digits with a binary code. In the
BCD, with four bits we can represent sixteen numbers (0000 to 1111). But in BCD code only the
first ten of these are used (0000 to 1001). The remaining six code combinations i.e. 1010 to 1111
are invalid in BCD.
0 1 2 3 4 5 6 7 8 9
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
The first row denotes the DECIMAL NUMBER and the second one the BINARY NUMBER.
6. Alphanumeric codes : - A binary digit or bit can represent only two symbols as it has only two
states '0' or '1'. The alphanumeric codes are the codes that represent numbers and alphabetic
characters. Mostly such codes also represent other characters such as symbols and various
instructions necessary for conveying information. An alphanumeric code should at least represent
10 digits and 26 letters of alphabet i.e. total 36 items.
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
Error detection and correction code plays an important role in the transmission of data from one source
to another. The noise also gets added into the data when it transmits from one system to another, which
causes errors in the received binary data at other systems. The bits of the data may change (either 0 to
1 or 1 to 0) during transmission.
Error in communication represents the fact that the input does not match with the output. In short, if you
are sending 0110, the output received at the receiver’s end is 1100.
Error-Detecting Codes
When a message gets transmitted, it may get corrupted due to interference of noise. To avoid this, we
use error-detecting codes which are additional data added to a given digital message to help us detect if
an error occurred during transmission of the message. One technique of error-detection is Parity Check.
Error-Correcting Codes
Error-correcting codes also deploy the same strategy as error-detecting codes but additionally, such
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
The MSB of an 8-bits word is used as the parity bit and the remaining 7 bits are used as data or
message bits. The parity of 8-bits transmitted word can be either even parity or odd parity.
Even parity: - Even parity means the number of 1's in the given word including the parity bit should be
Odd parity: - Odd parity means the number of 1's in the given word including the parity bit should be odd
(1, 3, 5,....).
BINARY ARITHMETIC
Binary Addition
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
The binary addition operation works similarly to the base 10 decimal system, except that it is a base 2
system. The binary system consists of only two digits, 1 and 0. Most of the functionalities of the
computer system use the binary number system. The binary code uses the digits 1’s and 0’s to make
certain processes turn off or on. The process of the addition operation is very familiar to the decimal
Now, let us understand this with an example of the binary addition; 101 + 101
♦ First consider the 1’s column, and add the one’s column,( 1+1 ) and it gives the result 10 as per
♦ Now, leave the 0 in the one’s column and carry the value 1 to the 10’s column.
♦ Now add 10’s place, 1+ (0 + 0) = 1. So, nothing carries to the 100’s place and leave the value 1 in
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
♦ Now add the 100’s place (1 + 1) = 10. Leave the value 0 in the 100’s place and carries 1 to the
1000’s place.
When you cross-check the binary value with the decimal value, the resultant value should be the same.
The binary value 101 is equal to the decimal value 5. So, 5 + 5 = 10
Binary Subtraction
Subtraction of binary numbers is an arithmetic operation similar to the subtraction of decimal numbers or
base 10 numbers. For example, 1 + 1 + 1 = 3 in base 10 and 1 + 1 + 1 = 11 in the binary number
system. When you add and subtract binary numbers, you will need to be careful when borrowing as
these will take place more often.
0 0 0 0
1 0 1 0
1 1 0 0
0 1 0 1
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
(1 1 0 1 0 1)2 = 5310
Now, taking the 1’s complement of the subtrahend and add with minuend.
(010000)2 = 1610
BOOLEAN ALGEBRA
The logical symbol 0 and 1 are used for representing the digital input or output. The symbols "1" and "0"
can also be used for a permanently open and closed digital circuit. The digital circuit can be made up of
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
several logic gates. To perform the logical operation with minimum logic gates, a set of rules were
invented, known as the Laws of Boolean Algebra. These rules are used to reduce the number of logic
gates for performing logic operations.
● Variables used can have only two values. 1 for HIGH and 0 for LOW.
B, C is represented as A + B + C.
● Logical ANDing of the two or more variable is represented by writing a dot between them such as
A.B.C. Sometime the dot may be omitted like ABC.
Boolean Laws
1. Commutative Law: - Commutative law states that changing the sequence of the variables does
not have any effect on the output of a logic circuit.
A+B = B+A
Commutative law of addition
A.B = B.A
Commutative law of multiplication
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
2. Associative Law: - This law states that the order in which the logic operations are performed is
1. A.0 = 0 3. A. A= A
2. A.1 = 1 4. A. A = 0
1. A+0 = A 3. A+A= A
2. A+1 = 1 4. A.A = 1
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
6. INVERSION Law: - This law uses the NOT operation. The inversion law states that double
A=A
LOGIC GATES
A logic gate is a virtual or physical device that performs a Boolean function. These are used to make
logic circuits. Logic gates are the main components of any digital system. This electrical circuit can have
only one output and 1 or more inputs. The relation between the input and the output is governed by
specific logic. AND, OR, NOT gate, etc are the examples of logic gates.
● AND Gate (Product): - A logic gate with two or more inputs and a single output is known as an
AND gate. The logic multiplication rules are used to operate an AND gate. An AND gate can have
any number of inputs, although the most common are two and three-input AND gates. If any of
the inputs are low (0), the output is also low in this gate. When all of the inputs are high (1), the
output will be high as well.
Truth table:
For AND gate, the output “out” is true if and only if both the inputs A and B are true. So the truth
table of AND gate is as follows:
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
A B OUT= A. B
T T T
T F F
F T F
F F F
● OR Gate (Sum): - A logic gate that performs a logical OR operation is known as an OR gate. If
one or both of the gate’s inputs are high, the logical OR operation produces a high output (1). (1).
If neither of the inputs is high, the result is a low output (0). In the same way that an AND gate
can have an unlimited number of input probes, an OR gate can only have one output probe. A
Truth table:
A B OUT= A + B
T T T
T F T
F T T
F F F
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
● NOT Gate (Complement): Inverting NOT gates are those devices that take only one input with an
output level that is ordinarily at logic level 1 and goes low to a logic level 0 when their single input
is at logic level 1, or in other words, they invert their input signal. A NOT gate’s output only returns
high, when its input is at logic level 0. The output P (compliment value of P) of a single input NOT
gate is only true when the input P is false or we can say, Not true. It is also called inverse gate as
it results the negation of the input Boolean Expression.
P NOT P
Truth table: - For the NOT gate, the output X is true if and only if input P is false. So the truth
P P
T F
F T
● NAND Gate: - A logic gate known as a NAND gate provides a low output (0) only if all of its inputs
are true, and high output (1) otherwise. As a result, the NAND gate is the inverse of an AND gate,
and its circuit is created by joining AND gate and NOT gate. NAND means ‘Not of AND’ Gate and
it results in false only when both the inputs P and Q are true. AND gates (together with NOR
gates) are known as universal gates because they are a form of logic gate that can implement
any Boolean function without the usage of any other gate type.
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
Truth table:
For the NAND gate, the output X is false if and only if both the inputs (i.e., P and Q) are true. So
A B OUT= (A.B)
T T F
T F T
F T T
F F T
● NOR Gate: A logic gate known as a NOR gate provides a high output (1) only if all of its inputs
are false and low output (0) otherwise. As a result, the NOR gate is the inverse of an OR gate,
and its circuit is created by joining OR gate and NOT gate. NOR means ‘Not of OR’ Gate & it
results in true only when both the inputs A and B are false.
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
A B Q= (A+ B)
T T F
T F F
F T F
F F T
● XOR Gate: - An XOR gate (also known as an Exclusive OR gate) is a digital logic gate that
conducts exclusive disjunction and has two or more inputs and one output. Only one of an XOR
gate’s inputs must be true for the output to be true. The output of an XOR gate is false if both of
its inputs are false or true if both of its inputs are true. XOR means ‘Exclusive OR’ Gate & it
results in true only when either of the 2 inputs P & Q is true, i.e., either A is true or B is true but
not both.
A B out= A ⊕ B
T T F
T F T
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
F T T
F F F
● XNOR Gate: - XNOR means ‘Exclusive NOR’ Gate and it result is true only when both of its
A B out= A B
T T T
T F F
F T F
F F T
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
DE MORGAN’S LAWS
Statement 1: The Complement of the product (AND) of two Boolean variables (or expressions) is equal
to the sum (OR) of the complement of each Boolean variable (or expression)
P Q
P Q P.Q P + Q
T T F F F F
T F F T T T
F T T F T T
F F T T T T
Statement 2: The Complement of sum (OR) of two Boolean variables (or expressions) is equal to the
product (AND) of the complement of each Boolean variable (or expression).
(P + Q) = (P).(Q)
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
Proof :
P Q
P Q P+ Q (P) . (Q)
T T F F F F
T F F T F F
F T T F F F
F F T T T T
COMBINATIONAL CIRCUITS
Digital logic circuits can be classified into “combinational” and “sequential”. A combinational logic circuit
is one whose output solely depends on its current inputs. Sequential circuits, on the other hand, are built
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
n input m output
variables variables
The 'n' input variable comes from the external source while the 'm' output variable goes to the external
destination. In many applications, the source or destinations are storage registers.
Half Adder
The half adder adds two binary digits and produces two outputs as sum and The half adder circuit is
designed to add two single bit binary number A and B. It is the basic building block for addition of two
single bit numbers. This circuit has two outputs carry and sum.
HALF
ADDER
INPUTS OUTPUTS
A B SUM CARRY
0 0 0 0
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
0 1 1 0
1 0 1 0
1 1 0 1
Full Adder
The difference between a half-adder and a full-adder is that the full-adder has three inputs and two
outputs, whereas a half adder has only two inputs and two outputs.
FULL
ADDER
INPUTS OUTPUTS
A B Cin SUM Co
0 0 0 0 0
0 0 1 1 0
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
Half Subtractors
A half subtractor is a multiple output combinational logic network that does the subtraction of two bits of
binary data. It has input variables and two output variables. Two inputs are corresponding to two input
bits and two output variables correspond to the difference bit and borrow bit.
INPUTS OUTPUTS
A B (A- BORROW
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
B)DIFFERENCE
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
Full Subtractors
The disadvantage of a half subtractor is overcome by a full subtractor. The full subtractor is a
combinational circuit with three inputs A,B,C and two outputs D and C'. A is the 'minuend', B is
'subtrahend', C is the 'borrow' produced by the previous stage, D is the difference output and C' is the
borrow output.
INPUTS OUTPUTS
A B Bin (A-B-Bin)
DIFFERENCE (D)
C= Bout
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
Encoders
An encoder is a logic circuit that converts digits to a binary coded format. This process is known as
encoding. An encoder has n inputs and m outputs. It has a maximum of 2 n input lines and 'n' output
lines.
Block Diagram
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
Decoders
A decoder is a circuit which has n inputs and 2n outputs, and outputs 1 on the wire corresponding to the
binary number represented by the inputs.
Block Diagram
Multiplexers
Multiplexing is the property of combining one or more signals and transmitting on a single channel. This
is achieved by the device multiplexer. A multiplexer is the most frequently used combinational circuit and
an important building block in many digital systems. A multiplexer is a device which allows one of a
number of inputs to be routed to a single output.
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
De-multiplexer
A De-multiplexer is a combinational circuit that has only 1 input line and 2 n output lines and n control
signals. The information is received from the single input lines and directed to the output line.
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
SEQUENTIAL CIRCUITS
The combinational circuit does not use any memory. Hence the previous state of input does not have
any effect on the present state of the circuit. But a sequential circuit has memory so output can vary
based on input. This type of circuit uses previous input, output, clock and a memory element.
Inputs Outputs
COMBINATIONAL
CIRCUITS
MEMORY
ELEMENTS
Flip Flop
Flip flop is a sequential circuit which generally samples its inputs and changes its outputs only at
particular instants of time and not continuously. Flip flop is said to be edge sensitive or edge triggered
rather than being level triggered like latches.
triggered SR-FF. For this, circuit in output will take place if and only if the enable input (E) is made
active. In short this circuit will operate as an S-R latch if E = 1 but there is no change in the output if E =
0.
Block Diagram
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
Circuit Diagram
When the S and R input of an S-R flip-flop is at logical 1, then the output becomes unstable and it is
known as race condition. When the S and R inputs of an SR flip-flop is at logical 1 and then the input is
changed to any other condition, then the output becomes unpredictable and this is called the race
condition.
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
Master slave JK FF is a cascade of two S-R flip flops with feedback from the output of second to input of
first. Master is a positive level triggered. But due to the presence of the inverter in the clock line, the
slave will respond to the negative level. Hence when the clock = 1 (positive level) the master is active
and the slave is inactive. Whereas when clock = 0 (low level) the slave is active and master is inactive.
Circuit Diagram
D Flip Flop
Delay Flip Flop or D Flip Flop is the simple gated S-R latch with a NAND inverter connected between S
and R inputs. It has only one input. The input data is appearing at the output after some time. Due to this
data delay between i/p and o/p, it is called delay flip flop. S and R will be the complements of each other
due to the NAND inverter. Hence S = R = 0 or S = R = 1, these input conditions will never appear. This
Block Diagram
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
Circuit Diagram
Toggle flip flop is basically a JK flip flop with J and K terminals permanently connected together. It has
only input denoted by T as shown in the Symbol Diagram. The symbol for positive edge triggered T flip
flop is shown in the Block Diagram.
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
Block Diagram
REGISTERS
A Register is a collection of flip flops. A flip flop is used to store single bit digital data. For storing a large
number of bits, the storage capacity is increased by grouping more than one flip flops. If we want to
store an n-bit word, we have to use an n-bit register containing n number of flip flops.
Types of Registers
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
1. Accumulator Register: - The CPU mostly uses an accumulator register. The accumulator register
is used to store the system result. All the results will be stored in the accumulator register when
the CPU produces some results after processing.
2. Program Counter: - The program counter is also called an instruction address register or
instruction pointer. In simple words, the program counter contains the memory address of the
location of the next instruction.
3. Memory Address Register: - The Memory Address Register is a special type of register that
storage.
5. Index Register: - In CPU, the index register is a processor register used to modify the operand
address during the running program.
6. Memory Buffer Register: - Memory Buffer Register is mostly called MBR. The MBR contains the
7. Data Register: - The data register is used to temporarily store the data. This data transmits to or
from a peripheral device.
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
A Literal signifies the Boolean variables including their complements. Such as, if A is a boolean variable,
1. MINTERM
The product of all literals, either with complement or without complement, is known as minterm.
Example
The minterm for the Boolean variables A and B is:
A.B
A.B’
A’.B
● If the variable value is 1, we will take the variable without its complement.
● If the variable value is 0, take its complement.
Example
Let's assume that we have three Boolean variables A, B, and C having values.
1,0 and 0 respectively i.e. A=1, B-0 and C=0.
Now, we will take the complement of the variables B and C because these values are 0 and will take A
without complement. So, Minterm=A.B'C'
Let's take another example in which we have two variables B and C having the value.
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
Minterm = AB'C'
Minterm = 100
● The binary number of the minterm AB'C' is 100. The decimal point number of (100)2 is 4. So, the
shorthand notation of AB'C' is
● Minterm = m4
2. MAXTERM: - The sum of all literals, either with complement or without complement, is known as
maxterm.
● If the variable value is 1, then we will take the variable without a complement.
Example
Let's assume that we have three Boolean variables A, B., and C having values
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)
We will take the complement of the variables B and C because these values are 0 and will take A
without complement. So, the maxterm will be: A+B'+C'
If Maxterm = A+B'
● The binary number of the maxterm A+B' is 10. The decimal point number of (10)2 is 2. So, the
shorthand notation of A+B' is
● Maxterm = M2
Click Here for GOAT (The Complete Mentorship Program for Bank Exams)