**Binary System**

## → Digital Computer:

A **digital computer** is a computer that uses the binary number system, which has two digits: 0 and 1. This means that all information in a digital computer is represented as a combination of these two digits.

## → Digital System:

A **digital system** is a system that uses discrete values to represent information.

**• Advantages of Digital System:-**

- simple operation
- low noise
- fabrication(process to make IC)
- easy storage
- easy to use
- less error
- easy to learn
- variety of digital IC

## • **Disadvantages of Digital System:-**

- requires large bandwidth
- more complex
- quantization noise is available

## → Number system:-

The classification of number on the basis of their uses is known as **number system.**

**Note:-** The number system has radix or base to represent the types of number system.

**∴ Base represents the following information:-**

- Identify the type of number system
- Total number contained by number system
- Range of number contained by the number system

• **Formula to find the range of any number system:-**

**Range**= 0 – (**base** – 1)

eg. 0 – (10-1)

=0 – 9

## → Types of number system:-

- Binary number system
- Decimal number system
- Hexa-decimal number system
- Octal number system

## ⁘ Decimal Numbers:

The number system which consist digits from **0 to 9** and whose base is **10 **is called** decimal number system**. In the decimal system, there are ten possible digits:** 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.**

## ⁘ Binary Numbers System:

The number system whose base is 2 and has only two possible digits: 0 and 1 is called as **binary number system.**

• Here, **1 **represents high-voltage and **0 **represents low- voltage.

• Each digit (i.e. **0 or 1**) in a binary number is called a “**bit**” (short for binary digit).

• **Note**: Binary number is less complicated than the decimal system because the binary system has only two digits.

∴ **Here’s an example of a binary number,**

**Binary Number**: (10100)2, (11011)2, (11001)2, (000101)2, (011010)2.

## ⁘ Hexa-decimal Number System:

The number system whose base is **16 **and the number contained is** 0-9** and **A-F** is called** hexa-decimal number system**. eg:-0 1 2 3 4 5 6 7 8 9 A B C D E F

## ⁘ Octal Number System:

The number system which consist digits from **0 **to **7 **and whose base is **8 **is called **octal number system**.

**Here’s an example of an octal number:Octal Number**: 345

**‣ points to be remembered!!!**

In** 11010**:- here, **1 **is Most Significant Bit**(MSB)** and **0 **is Least Significant Bit**(LSB)**

**Number Base Conversion:**

## Binary to Decimal:

## Binary to Octal:

## Binary to hexadecimal:

## Decimal to binary:

**Example 1: (152.25) _{10}**

**Step 2: **

**Now, perform the multiplication of 0.25 and successive fraction with base 2.**

## Decimal to Octal:

**Example 1: (152.25) _{10}**

## Decimal to Hexadecimal:

## Octal to Binary:

## Octal to Decimal:

**Example 1: (152.25) _{8}**

## Octal to Hexadecimal:

## Hexadecimal to binary:

## Hexadecimal to Octal:

## Hexadecimal to Decimal:

Q). Convert:- (1101)_{2} into decimal equivalent.solution:-1*2 ^{3}+1*2^{2}+0*2^{1}+ 1*2^{0}= 8+4+0+1 =13 |

## → **Binary Adding**

## ∴ **Rules of binary adding:-**

- 0+0= 0 sum of 0 with a carry of 0
- 0+1=1 sum of 1 with a carry of 0
- 1+0=1 sum of 1 with a carry of 0
- 1+1=0 sum of 0 with a carry of 1

→ **How to convert decimal into binary:**

**Convert the remaining by yourself**.

## Conversion Table

Decimal Number | Binary Equivalent |

0 | 0 0 0 0 |

1 | 0 0 0 1 |

2 | 0 0 1 0 |

3 | 0 0 1 1 |

4 | 0 1 0 0 |

5 | 0 1 0 1 |

6 | 0 1 1 0 |

7 | 0 1 1 1 |

8 | 1 0 0 0 |

9 | 1 0 0 1 |

10 | 1 0 1 0 |

11 | 1 0 1 1 |

12 | 1 1 0 0 |

13 | 1 1 0 1 |

14 | 1 1 1 0 |

15 | 1 1 1 1 |

**Fig:-Table of Decimal number to Binary Equivalent**

## → **Binary subtraction:-**

## • **Rules of binary subtraction:-**

- 0-0= 0
- 1-1= 0
- 1-0= 1
- 0-1= 1 with a borrow of 1
**Note**:-In binary 10-1=1, not 9

**Complements of Binary Numbers:-**

**Note**: The** 1`s complement** and the **2`s complement** of a binary number are important because they permit the representation of negative numbers.

**∴ Finding the 1`s complement:-**

The **1`s complement** of a binary number is found by changing all **1s** to** 0s** and all **0s** to** 1s**.

→ **How to find 1`s complement of binary number.**

∴ **1`s complement using NOT gate.**

Q). Find the 1`s complement of (10110)_{2}solution:-1`s complements = 01001 |

**Finding the 2`s complement**

The** 2`s complement** of a binary number is found by adding 1 to the LSB of the 1`s complement.

∴ **2`s complement = (1`s complement) + 1**

→ **How find 2`s complement of binary number**?

∴ **Alternative way to find direct 2`s complement**

- Start at the right with the LSB and write the bits as they are up to and including the first 1.
- Yake the 1`s complement of the remaining bits

**In the above solution**, we should write the same binary digits from right to left until we found 1, after that change the remaining bits into 1`s complement as shown above.

**∴ Concept of MINUEND and SUBTRAHEND**

**→ 9`s Complement & 10`s complement**:

If the number is binary, then we use 1’s complement and 2’s complement. But in case, when the number is a decimal number, we will use the 9’s and 10’s complement.

**• 9`s Complement**:

The** 9’s complement** is used to find the subtraction of the decimal numbers.

**• **The 9’s complement of a number is calculated by subtracting each digit of the number by 9.

## • Subtraction using 9’s complement

• **Step 1:** Find 9`s complement of subtrahend

**• Step 2:** Add the 9`s complement with the minuend.

**Note**: If there is carry, add the carry to the result to get the final result, else find the 9`s complement of the reuslt and put negative sign to MSB.

**Case 1: When the subtrahend is smaller than the minuend.**

**Case 2: When the subtrahend is greater than the minuend.**

## ⁘ 10’s complement

The 10’s complement is also used to find the subtraction of the decimal numbers.

• The 10’s complement of a number is calculated by subtracting each digit by 9 and then adding 1 to the result. Simply, by adding 1 to its 9’s complement we can get its 10’s complement value.

## • Subtraction using 10’s complement

**• Step 1:** Find 10`s complement of subtrahend

• **Step 2:** Add 10`s complement with minuend

**Note**: if there is any carry discard it, else again find 10`s complement of result and put negative sign to MSB.

**Case 1: When the subtrahend is smaller than the minuend.**

**Case 2: When the subtrahend is greater than the minuend.**

**→ Subtraction using 1`s complement**

• **Step 1:-** Take 1`s complement of subtrahend

• **Step 2:-** Add 1`s complement of subtrahend with minuend

**• Step 3:-** If got a carry, add the carry to its LSB. Else take 1’s complement of the result and put negative sign

**Subtracting using 2`s complement**

Step 1. Take 2`s complement of subtrahend

Step 2. Add 2`s complement of subtrahend with minuend

Step 3. If there is no carry , the result is negative and take the 2`s complement of above result and place negative sign in the final result.

## Binary Coded Decimal:

**Binary coded decimal(BCD)** is a way to express each of the decimal digits with a binary code.

There are only ten code group in the BCD system, so it is very easy to convert between decimal and BCD.

## The 8421 BCD Code:

The 8421 BCD code is a binary-coded decimal (BCD) code that represents a decimal number as a four-bit binary number, where each bit represents one of the decimal digits 8, 4, 2, and 1.

## Invalid Codes:

**Invalid BCD codes** are binary-coded decimal (BCD) codes that do not represent a valid decimal digit. The 8421 BCD code has six invalid codes, which are:

- 1010
- 1011
- 1100
- 1101
- 1110
- 1111

**Note**: These codes are invalid because they do not correspond to any of the decimal digits 0 to 9.

## The Gray Code:

The** Gray code** is a binary code in which two successive values differ in only one bit. This means that any two adjacent Gray codes differ by only one bit in their binary representation.

The Gray code is named after Frank Gray, who invented it in 1953. It is also known as the reflected binary code, because the first half of the Gray code is simply a reflection of the second half.

## Binary to Gray code conversion:

**Rules:**

- The most significant bit (MSB) of the Gray code is the same as the MSB of the binary code.

## Gray to Binary code conversion:

**Rules:**

- The most significant bit (MSB) of the binary code is the same as the MSB of the Gray code.

**Bit Interval and Bit Rate:-**

**Bit interval:-** The time required to send 1 signal bit is known as bit interval.

**Bit Rate:-** Bit rate is the number of the bit interval per second. It is measured in bit per second . It is also known as bandwidth.

**Boolean Algebra Logic Gates**

## → **Boolean Algebra**

It is a branch of mathematics that deals with operation on logical values with binary numbers where ‘**0**‘ represented as **false **and ‘**1**‘ is represented as **true**.

## ∴ Rules in Boolean algebra

• Only two values(**1 for high and 0 for low**) are possible for the variable used in Boolean algebra.

• The **overbar(-)** is used for representing the complement variable. So, the complement of variable C is represented as .

• The **plus(+)** operator is used to represent the **ORing** of the variables.

• The **dot(.) **operator is used to represent the **ANDing** of the variables.

## → Axiomatic definiton of boolean algebra

A **Boolean algebra** is a set of axioms, or postulates, that define the fundamental properties and operations of Boolean algebra.

**Note:-** The Boolean algebra allows only two possible value that is ‘0’ and ‘1’ for any variables. Symbols used in Boolean algebra do not present any numerical values.

## → Logic Gates:

**Logic gates** are the basic building blocks of digital circuits. They perform simple logical operations on one or more binary inputs and produce a single binary output.

## Types of Logic gates:

There are **seven **types of logic gates:

- AND gate
- OR gate
- NOT gate
- NAND gate
- NOR gate
- XOR gate
- XNOR gate

## • AND Gate:

An **AND gate** is a digital logic gate that performs the logical conjunction operation. The output of an AND gate is true (1) only when all of its inputs are true (1); otherwise, the output is false (0).

• This gate has a minimum of **2 input **values and a **single output** value.

## ‣ Logical Circuit:

## ‣ Truth Table:

## • OR Gate:

An **OR gate** is a digital logic gate that performs the logical disjunction operation. The output of an OR gate is true (1) if at least one of its inputs is true (1); otherwise, the output is false (0).

• This gate also has a minimum of** 2 input** values and a **single output** value.

## ‣ Logical circuit:

## ‣ Truth Table:

## • NOT Gate:

A **NOT gate **is a digital logic gate that performs the logical negation operation. If the input is true (1), the output is false (0), and if the input is false (0), the output is true (1).

• It is also known as **inverter**.

• This gate has only **one input **and **one output** value.

## ‣ Logical Circuit:

## ‣ Truth Table:

## • NAND Gate:

A **NAND gate** is a digital logic gate that performs the logical negation of the AND operation. If all the inputs of NAND gate are True(1), then the output will be false(0), otherwise True(1).

• The NAND gate is the **universal gate** because all the basic gates such as AND, OR, and NOT gate can be constructed using a NAND gate.

• The NAND gate is the combination of the NOT-AND gate.

## ‣ Logical Circuit:

## ‣ Truth Table:

## » AND Gate using NAND Gate:

## » OR Gate using NAND Gate:

## » NOT Gate using NAND Gate:

## • NOR Gate:

A** NOR gate** is a digital logic gate that performs the logical negation of the OR operation. The output of a NOR gate is true (1) only when none of its inputs are true (1); otherwise, the output is false (0).

• It is also a **universal gate** because all the basic gates such as AND, OR, and NOT gate can be constructed using a NOR gate.

• The NOR gate is the combination of the **NOT-OR gate**.

## ‣ Logical Circuit:

## ‣ Truth Table:

## » AND Gate using NOR Gate:

## » OR Gate using NOR Gate:

## » NOT Gate using NOR Gate:

## • XOR Gate:

An **XOR gate**, or** exclusive OR** **gate**, is a digital logic gate that performs the logical exclusive disjunction operation. It produces a True(1) output only if one of its inputs is True and the other is false.

• It is a hybrids gate.

## ‣ Logical Circuit:

## ‣ Truth Table:

## • XNOR Gate:

An **XNOR gate**, or **exclusive NOR gate**, is a digital logic gate that performs the logical equivalence operation.The output of an XNOR gate is true (1) if both inputs are the same (either both true or both false); otherwise, the output is false (0).

• It is also a **hybirds gate**.

• The XNOR gate is also called the **Equivalence gate**.

## ‣ Logical Circuit:

## ‣ Truth Table:

## → Basic Theorem and properties of Boolean Algebra:

**1).** A+0=A

**2).** A+1=1

**3).** A.0=0

**4).** A.1=A

**5).** A+A=A

**6).** A+A’=1

**7).** A.A=A

**8).** A.A’=0

**9).** A”=A

**10).** A+AB=A

**A + AB = A(1 + B) ∴ Factoring (distributive law)
A + AB = A.1 ****∴ **Rule 2: (1 + B)= 1
A + AB = A **∴ **Rule 4: A .1 = A

**11).** A+A’B=A+B

**=(A+A') (A+B) ∴ x+yz=(x+y)(x+z)
=1(A+B)
=A+B**

**12).** (A+B) (A+C)=A+BC

**= AA + AC + AB + BC ****∴ **Distributive law
= A + AC + AB + BC **∴ **Rule 7: AA = A
= A( 1 + C)+ AB + BC **∴ **Rule 2: 1 + C = 1
= A.1 + AB + BC **∴** Factoring (distributive law)
= A(1 + B)+ BC **∴** Rule 2: 1 + B = 1
= A.1 + BC **∴ **Rule 4: A .1 = A
= A + BC

## → Laws of Boolean Algebra:

- Commutative Law
- Associative Law
- Distributive Law

## → Commutative Law:

**A+B = B+A**

**A.B = B.A**

## → Associative Law:

**A + (B + C) = (A + B) + C**

**A(BC) = (AB)C**

## → Distributive Law:

**A(B + C) = AB + AC**

## Demorgan`s Law:

## Canonical Form:

## Literal:

A **literal **is a variable or its negation.

**Here are some examples of literals in digital logic:**

- A variable: A, B, C, D
- The complement of a variable: A’, B’, C’, D’

## Minterm:

The product of all literals, either with complement or without complement, is known as **minterm**.

• In this term, **0 **is represented in complemented form.

• It is denoted by ‘**m**‘/ **ƒ=∑m**.

## Maxterm:

The sum of all literals, either with complement or without complement, is known as **maxterm**.

• In this term, **1 **is represented in complemented form.

• It is denoted by ‘**M**‘ / **ƒ=πM**.

**Maxterm from values**Using the given variable values, we can write the maxterm as:

• If the variable value is 0, then we will take the variable without a complement.

• If the variable value is 1, take the complement of the variable.

```
Domain of Boolean expression:
The domain of boolean expression is the set of variables contained in the expression in either complemented or uncomplemented form.
for example:
The domain of the boolean expression, A'B+AB'C is the set of variables A,B,C
```

## Sum of product(SOP):

The **sum of product (SOP)** is a Boolean expression that is formed by summing together a number of product terms.

A **product term** is a Boolean expression that is formed by ANDing together a number of variables or their complements.

The SOP form of a Boolean function is a convenient way to represent the function, as it can be easily implemented in hardware using AND and OR gates.

**Some examples are:**

**AND/OR implemention of an SOP expression:**

**NAND/NAND implementation of an SOP expression:**

## The Standard SOP form:

A standard SOP expression is one in which all the variables in the domain appear in each product term in the expression.

**Example:**

## Converting Product term to Standard SOP:

## Product of sum(POS):

The **product of sum (POS)** is a Boolean expression that is formed by multiplying together a number of sum terms.

A sum term is a Boolean expression that is formed by ORing together a number of variables or their complements.

The POS form of a Boolean function is another convenient way to represent the function, as it can also be easily implemented in hardware using AND and OR gates.

**Some examples are:**

## Implementation of POS expression:

## The Standard POS Form:

A standard POS expression is one in which all the variables in the domain appear in each sum term in the expression.

**Example:**

## Converting a Sum Term to Standard POS:

## Conversion of SOP form to standard SOP form:

## Conversion of POS form to standard POS form:

**Simplification of Boolean Functions**

• **Simplification of Boolean algebra** is the process of reducing a Boolean expression to its simplest form.

## Map methods

**Map methods **are a graphical way to simplify Boolean expressions. The most common map methods are the **Karnaugh map **and the **Quine**–**McCluskey method**.

## Karnaugh map

The **K-map** is a systematic way of simplifying Boolean expressions. With the help of the K-map method, we can find the simplest POS and SOP expression, which is known as the minimum expression. The K-map provides a cookbook for simplification.

• **A k-map is similar to a truth table** because it presents all of the possible values of input variables and the resulting output for each value.

• In K-map, the number of cells is similar to the total number of variable input combinations. **For example**, if the number of variables is three, the number of cells is 2^{3}=8, and if the number of variables is four, the number of cells is 2^{4}.

• The K-map takes the **SOP **and **POS **forms.

• The K-map grid is filled using **0’s** and **1’s**. The K-map is solved by making groups.

**Note:
Cell Adjacency:** **The cells that differ by only one bit are called as cell adjacency.**

## 2 Variable K-map

A **2-variable Karnaugh map (K-map)** is a table with 4 cells, each representing a different combination of the two input variables, **A **and **B**. The value of each cell is the value of the output variable, F, for that combination of input variables.

## 3-variable K-map

A **3-variable Karnaugh map (K-map) **is a table with 8 cells, each representing a different combination of the three input variables, **A**, **B**, and **C**. The value of each cell is the value of the output variable, F, for that combination of input variables.

## 4-variable k-map

A **4-variable Karnaugh map (K-map)** is a table with 16 cells, each representing a different combination of the four input variables, **A**, **B**, **C**, and **D**. The value of each cell is the value of the output variable, F, for that combination of input variables.

## 5-variable K-map:

A **5-variable Karnaugh map (K-map)** is a graphical method for simplifying Boolean expressions with five variables.

• A K-map for five variables (ABCDE) can be constructed using two 4-variable maps. Each map contains 16 cells with all combinations of variables B, C, D, and E. One map is for A = 0, and the other is for A = 1).

## Mapping a standard SOP expression:

For an SOP expression in standard form, a 1 is placed on the K-map for each product term in the expression.

Usually, when working with SOP expressions, the 0s are left off the map.

**Steps:**

- Determine the binary value of each product term in the standard SOP expression.
- Place a 1 on the k-map in the cell having the same value as the product term.

**Example:**

## Mapping a Non-standard SOP expression:

## Grouping the 1s:

**Rules:**

- A group must contain either 1,2,4,8, or 16 cells, which are 2
^{n}. (In the case, 3-variable map, 2^{3}=8 cells is the maximum group.) - Always include the largest possible number of 1s in a group.
- Overlapping is allowed.

## Determining the Minimum SOP expression from the Map:

**Rules**:

- Group the cells that have 1s. Each group of cells containing 1s create one product term composed of all variables.
- Determine the minimum product term for each group.
- When all the minimum product terms are derived, they are summed to form the minimum SOP expression.

## Don`t Care Conditions:

**Combinational Logic**

## → Definition:

**Combinational logic **refers to a type of design in which the outputs are solely determined by the current inputs without considering any previous inputs or outputs.

• In other words, the output of combinational logic circuits is determined by the combination of input values at a specific instance of time, and there is no memory used.

• A combinational circuit can have an **n **number of inputs and **m **number of outputs.

## Block Diagram:

## Designing Procedure of Combinational Circuit:

**Block Diagram****Truth Table****K-Map-(Boolean expression from k-Map)****Logic Circuit**

## → Adder:

**Adders **are fundamental components in digital logic circuits that perform arithmetic operations, usually addition on binary numbers.

• They’re used extensively in computer processors, calculators, and other digital devices.

• It has three types: half adder, full adder and parallel n-bit adder

## → Half Adder:

A **half adder** is a basic digital logic circuit that adds two single binary digits (bits) together. It produces two outputs: a sum and a carry.

• It’s called a “half” adder because it doesn’t account for any carry that might result from adding multiple bits together in larger numbers.

• A half adder has two inputs: A and B, representing the two bits to be added. It generates two outputs:

**Sum (S): **This output represents the result of the addition of the two input bits, without considering any carry from a previous stage. The sum is calculated using an XOR gate, which outputs 1 when the number of input bits that are 1 is odd.

**Carry (C):** This output indicates whether there is a carry generated from adding the two input bits. The carry is calculated using an AND gate, which outputs 1 when both input bits are 1.

## • Block Diagram:

## • Truth Table:

## • K-map:

## → Full Adder:

A **full adder** is a more advanced digital logic circuit compared to a half adder.

• It’s designed to add three binary inputs: two operands (A and B) and a carry input (C-in) from a previous stage.

• The full adder produces two outputs: a sum (S) and a carry output (C-out).

## • Block Diagam:

## • Truth Table:

## • K-Map:

## Logic Circuit:

## Parallel n-bit Adder:

A **parallel n-bit adder** is a digital circuit that adds two n-bit binary numbers in parallel, meaning all corresponding bits of the two numbers are added simultaneously.

It consists of multiple full adders, one for each bit position, and produces the sum and carry outputs for each position.

## Block Diagram:

## Truth Table:

## K-Map:

## Subractor:

A **subtractor **is a digital circuit that performs subtraction of binary numbers.

It’s a fundamental component in digital logic systems and is used to calculate the difference between two binary values.

**Key components of a subtractor include:**

**Minuend**: The number from which subtraction is performed.**Subtrahend**: The number that is subtracted from the minuend.**Borrow (Borrow-in):** A signal indicating whether a borrow needs to be taken into account in subtraction.**Difference**: The result of the subtraction operation.**Borrow-out**: A signal indicating whether a borrow occurred in the subtraction operation.

There are different types of subtractors, including** half subtractors**,** full subtractors**, and **n-bit parallel subtractors.**

## Half Subractor:

A** half subtractor** is a digital circuit that performs subtraction of two single binary digits (bits).

It produces two outputs: a difference (D) and a borrow (B) output.

Unlike a full subtractor, a half subtractor doesn’t take into account any borrow from a previous stage, making it suitable for subtracting two individual bits.

## Block Diagram:

## Truth Table:

## K-Map:

## Logic Circuit:

## Full Subtractor:

A **full subtractor** is a digital circuit that performs subtraction of three single binary digits: the minuend bit (A), the subtrahend bit (B), and a borrow-in bit (Bin) from a previous stage.

It produces two outputs: a difference (D) and a borrow-out (Bout) output.

Unlike a half subtractor, a full subtractor takes into account both the subtrahend and the potential borrow from the previous stage.

## Block Diagram:

## Truth Table:

## K-Map:

## Logic Circuit:

## → Encoders:

An **encoder **is a digital circuit that converts a set of input signals into a coded output representation.

• In other word, An **encoder **is a combinational logic circuit that essentially performs a “reverse” decoder function.

• It’s used to convert data from one format to another, often for purposes such as data compression, error detection, or multiplexing.

• They are commonly used in digital communication systems, control systems, and data processing applications.

**The representation of the encoder is shown in the below image –**

## → Decoders:

A **decoder** is a digital circuit that performs the opposite function of an encoder. It takes coded input signals and converts them into a set of output signals.

• They are commonly used to select or enable specific components or functions based on the encoded input.

• They are widely used in digital systems for applications such as memory addressing, data routing, control signal generation, and more.

**The representation of the decoder is shown in the below image –**

## → Difference between Encoder and Decoder:

## → Multiplexers:

A **multiplexer**, often referred to as a “**mux**,” is a digital circuit that selects one of several input signals and forwards it to a single output line.

• It’s used to combine multiple data sources into a single line, which simplifies data transmission and control in various digital systems.

• They are also used for signal routing, data selection, and communication channel switching.

• The key components of a multiplexer are the input lines, the control inputs (often called “select lines”), and the output line.

## → Demultiplexers:

A **demultiplexer**, commonly referred to as a “**demux**,” is a digital circuit that takes a single input signal and distributes it to one of several possible output lines based on the value of control inputs.

• They essentially perform the opposite function of multiplexers, which combine multiple inputs into a single output.

• They are used to route a single input to a specific output line, making them useful for applications such as data distribution, memory interfacing, and address decoding in digital systems.

• A demultiplexer typically has one input line, multiple output lines, and control inputs that determine which output line receives the input signal. The number of control inputs corresponds to the number of possible output lines, and the value of these control inputs determines the selection of the output line.

**Sequential Logic**

The **sequential circuit **is a special type of circuit that has a series of inputs and outputs. The outputs of the sequential circuits depend on both the combination of present inputs and previous outputs.

• The previous output is treated as the present state. So, the sequential circuit contains the combinational circuit and its memory storage elements.

• A sequential circuit doesn’t need to always contain a combinational circuit. So, the sequential circuit can contain only the memory element.

**Difference between the combinational circuits and sequential circuits are given below:**

## Latches:

A **latch **is a bistable digital circuit, meaning it has two stable states. It is used to store a single bit of information and hold its value until it is updated by new input signals.

• Latches and flip-flops are both bistable devices, meaning they have two stable states. This means that they can store a single bit of information and hold its value until it is updated by new input signals.

• Latches and flip-flops are also both made up of logic gates.

• **The main difference between latches and flip-flops** is that latches are level-triggered, while flip-flops are edge-triggered.

## Difference between Latches and flipflops:

## Flip-Flops

A** flip-flop** is a bistable digital circuit that is used to store a single bit of information. It has two stable states, which are typically represented by the binary digits 0 and 1.

• They are also known as bistable multivibrators or R-S latches.

• A **synchronous circuit** is a circuit in which the changes in the state of the circuit are synchronized by a clock signal. This means that all of the state changes in the circuit occur at the same time, in response to the rising or falling edge of the clock signal.

• A **clock **is a signal that oscillates between two levels at a regular frequency. The clock signal is used to synchronize the operation of digital circuits. This means that all of the state changes in the circuit occur at the same time, in response to the rising or falling edge of the clock signal.

## Edge-triggered flip-flop:

An **edge-triggered flip-flop** is a sequential logic device that changes state on the rising or falling edge of a clock signal. It is also known as a clocked flip-flop.

• A **positive edge-triggered flip-flop** is a flip-flop that changes state on the rising edge of the clock signal. This means that the output of the flip-flop is set to the value of the input signal on the rising edge of the clock signal. When the clock signal is low, the output of the flip-flop remains in its current state.

• A **negative edge-triggered flip-flop** is a flip-flop that changes state on the falling edge of the clock signal. This means that the output of the flip-flop is set to the value of the input signal on the falling edge of the clock signal. When the clock signal is high, the output of the flip-flop remains in its current state.

## The D Flip-Flop:

A D flip-flop, also known as a delay flip-flop, is a synchronous sequential logic circuit that stores one bit of data. It has one data input (D) and one clock input (C). The output (Q) of the flip-flop is equal to the value of the D input on the rising edge of the clock signal.

When D is HIGH, the output goes HIGH on the triggering edge of the clock pulse, and the flip-flop is SET. When D is LOW, the output goes LOW on the triggering edge of the clock pulse, and the flip-flop is RESET.

## Basics of Flip Flop

A circuit that has two stable states is treated as a flip flop. These stable states are used to store binary data that can be changed by applying varying inputs. The flip flops are the fundamental building blocks of the digital system. Flip flops and latches are examples of data storage elements. In the sequential logical circuit, the flip flop is the basic storage element. The latches and flip flops are the basic storage elements but different in working. There are the following types of flip flops

## SR Flip Flop

The S-R flip flop is the most common flip flop used in the digital system. In SR flip flop, when the set input “S” is true, the output Y will be high, and Y’ will be low. It is required that the wiring of the circuit is maintained when the outputs are established. We maintain the wiring until set or reset input goes high, or power is shutdown.

The S-R flip flop is the simplest and easiest circuit to understand.

**Truth Table:**

## J-K Flip-flop

The JK flip flop is used to remove the drawback of the S-R flip flop, i.e., undefined states. The JK flip flop is formed by doing modification in the SR flip flop. The S-R flip flop is improved in order to construct the J-K flip flop. When S and R input is set to true, the SR flip flop gives an inaccurate result. But in the case of JK flip flop, it gives the correct output.

In J-K flip flop, if both of its inputs are different, the value of J at the next clock edge is taken by the output Y. If both of its input is low, then no change occurs, and if high at the clock edge, then from one state to the other, the output will be toggled. The JK Flip Flop is a Set or Reset Flip flop in the digital system.

**Truth Table:**

## D Flip Flop

D flip flop is a widely used flip flop in digital systems. The D flip flop is mostly used in shift-registers, counters, and input synchronization.

**Truth Table:**

T Flip Flop

Just like JK flip-flop, T flip flop is used. Unlike JK flip flop, in T flip flop, there is only single input with the clock input. The T flip flop is constructed by connecting both of the inputs of JK flip flop together as a single input.

The T flip flop is also known as Toggle flip-flop. These T flip-flops are able to find the complement of its state.

Truth Table:

Types of Triggering

These are two types of triggering in sequential circuits:

Level triggering

The logic High and logic Low are the two levels in the clock signal. In level triggering, when the clock pulse is at a particular level, only then the circuit is activated. There are the following types of level triggering:

Positive level triggering

In a positive level triggering, the signal with Logic High occurs. So, in this triggering, the circuit is operated with such type of clock signal. Below is the diagram of positive level triggering:

Negative level triggering

In negative level triggering, the signal with Logic Low occurs. So, in this triggering, the circuit is operated with such type of clock signal. Below is the diagram of Negative level triggering:

Edge triggering

In clock signal of edge triggering, two types of transitions occur, i.e., transition either from Logic Low to Logic High or Logic High to Logic Low.

Based on the transitions of the clock signal, there are the following types of edge triggering:

Positive edge triggering

The transition from Logic Low to Logic High occurs in the clock signal of positive edge triggering. So, in positive edge triggering, the circuit is operated with such type of clock signal. The diagram of positive edge triggering is given below.

Negative edge triggering

The transition from Logic High to Logic low occurs in the clock signal of negative edge triggering. So, in negative edge triggering, the circuit is operated with such type of clock signal. The diagram of negative edge triggering is given below.

**Registers, Counters and the Memory Unit**

## → Introduction:

A **register **refers to a sequential digital circuit component used to store and manage a group of binary bits.

• **Registers **are used for various purposes, such as holding data temporarily, facilitating data movement, and supporting various types of data processing operations within a digital system.

• **Registers **typically consist of multiple flip-flops that are interconnected to form a multi-bit storage unit. Each flip-flop within the register holds one bit of data, and together they can collectively store multi-bit values.

• The arrangement of flip-flops and the logic connecting them determine the size and functionality of the register.

## → Types of Register:

There are several types of registers used in digital logic and computer architecture, each designed for specific purposes. Here are some common types of registers:

• **Shift Register**: A shift register is a type of register that allows data to be shifted in one direction, either left or right. Shift registers can be used for data storage, data manipulation, and synchronization purposes.

• **Buffer Register**: A buffer register is used to hold data temporarily and isolate one part of a digital circuit from another, preventing unwanted interaction.

• **Control Register**: This type of register holds control bits that determine the behavior or configuration of a digital system. It’s used to set parameters, enable/disable features, or configure modes of operation.

**• Status Register**: A status register holds flags or indicators that provide information about the state of a system or its components. These flags can signal conditions such as overflow, zero, carry, etc.

## → Shift Register:

A **shift register** is a digital circuit component that allows data to be shifted in one direction (either left or right) through a series of flip-flops.

• Shift registers are widely used in various applications, including data storage, data transfer, data manipulation, and synchronization.

• They are particularly useful for handling serial data streams and performing serial-to-parallel or parallel-to-serial conversions.

• The data is shifted from one flip-flop to another in response to clock pulses. The direction of shifting (left or right) is determined by control signals.

## → Types of Shift Register:

**There are various types of shift registers, including:**

- Serial In Serial Out
- Serial In Parallel Out
- Parallel In Serial Out
- Parallel In Parallel Out
- Bi-directional Shift Register
- Universal Shift Register

**• Serial-In-Serial-Out (SISO) Register: **SISO registers enable serial loading and serial retrieval of data. They are used in applications where data is shifted in and out in a serial fashion.

**• Serial-In-Parallel-Out (SIPO) Register:** SIPO registers accept data in a serial manner but provide a parallel output. These are commonly used in applications such as LED displays or memory interfacing.

**• Parallel-In-Serial-Out (PISO) Register:** PISO registers allow parallel loading of data but provide a serial output. These registers are useful when data needs to be shifted out serially after being loaded in parallel.

**• Parallel-In-Parallel-Out (PIPO) Register:** This type of register allows for both parallel loading (input) and parallel retrieval (output) of data. It’s commonly used in data storage and data transfer operations.

**Shift registers have various applications, such as:**

• Serial data transmission and reception in communication systems.

• Creating delay lines or time delays.

• Implementing counters and frequency dividers.

• Scanning and controlling multiple outputs, like LED matrices.

• Implementing shift and rotate operations in arithmetic and logic operations.

## → Counters:

**Counters **are digital circuits used to keep track of events, occurrences, or the passage of time. They are widely used in various applications, including digital systems, control systems, communication systems, and more. Counters count the number of input pulses or events and provide a digital output that represents the count value.

## Memory Unit:

A memory unit is a device or system that stores information. Memory units are used in a variety of electronic devices, including computers, smartphones, and tablets.

## Importance of Memory Units:

- Speed
- Temporary storage
- Multitasking
- Reliability
- Accessibility
- Energy efficiency

Speed: Memory units play a critical role in the speed of digital systems. By storing data in memory, digital systems can access data quickly and efficiently without having to retrieve it from slower storage devices, such as hard disk drives. This is essential for many applications, such as running programs, accessing files, and streaming video.

Temporary storage: Memory units can be used to store data temporarily, such as the data that is currently being processed by the CPU or the data that is being displayed on the screen. This is essential for many applications, such as running programs, accessing files, and editing documents.

Multitasking: Memory units allow digital systems to run multiple programs at the same time by storing the data and instructions for each program in memory. This allows users to switch between programs quickly and easily without having to wait for each program to load from disk.

Reliability: Memory units are typically very reliable and can store data accurately for long periods of time. This is essential for many applications, such as storing important data files and operating systems.

Accessibility: Memory units can be easily accessed by the CPU and other components of a digital system. This allows digital systems to access data quickly and efficiently without having to go through complex procedures.

Energy efficiency: Memory units are becoming increasingly energy efficient, which is important for battery-powered devices such as smartphones and tablets.

## Types of memory units:

Exam Questions of Digital Logic |

## Binary System

#### 1. Define binary.

**ans**: **Binary **is a number system that uses only two digits: **0 **and **1**. It is also known as the base-2 numeral system.

## 2. What does bit mean?

**ans**: A **bit **is a binary digit, the smallest unit of data in computing and digital communications. A bit can hold only one of two values: 0 or 1, corresponding to the electrical values of off or on, respectively.

#### 3. What are the bits in a binary system?

**ans**: **Bits **are the building blocks of the binary system. Each bit can have one of two values: 0 or 1.

#### 4. What is the largest decimal number that can be represented in binary with eight bits?

**ans**: The largest decimal number that can be represented in binary with eight bits is 255.

This is because the largest binary number with eight bits is 11111111, which is equal to

2^7 + 2^6 + 2^5 + 2^4 + 2^3 + 2^2 + 2^1 + 2^0

= 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1

= 255.

#### 5. Determine the weight of the binary number 10000.

**ans**: The weight of binary number 10000 is 16.

= 10000

= 1×2^{4} + 0×2^{3 }+ 0×2^{2 }+ 0×2^{1} + 0×2^{0}

= 16

#### 6.

→ Binary to Decimal Conversion: |

Q1). Convert the binary number 101010 to its decimal equivalent.solution:= 1×2 ^{5} + 0×2^{4} + 1×2^{3} + 0×2^{2} + 1×2^{1} + 0×2^{0}= 32+0+8+0+2+0 = (42)_{10} |

Q2). Convert the binary number 1101101 to its decimal equivalent.:solution = 1×2 ^{6} + 1×2^{5} + 0×2^{4} + 1×2^{3} + 1×2^{2} + 0×2^{1} + 1×2^{0}= 64+32+0+8+4+0+1 = (109)_{10} |

Q3). Convert the binary number 110011 to its decimal equivalent.:solution = 1×2 ^{5} + 1×2^{4} + 0×2^{3} + 0×2^{2} + 1×2^{1} + 1×2^{0}= 32+16+0+0+2+1 = (51)_{10} |

Q4). Convert the binary number 1001100 to its decimal equivalent.solution:= 1×2 ^{6} + 0×2^{5} + 0×2^{4} + 1×2^{3} + 1×2^{2} + 0×2^{1} + 0×2^{0}= 64+0+0+8+4+0+1 = (77)_{10} |

Q5). Convert the binary number 11110000 to its decimal equivalent.solution:= 1×2 ^{7} + 1×2^{6} + 1×2^{5} + 1×2^{4} + 0×2^{3} + 0×2^{2} + 0×2^{1} + 0×2^{0}= 128+64+32+16+0+0+0+0 = (240)_{10} |

→ Decimal to Binary Conversion: |

Q1). Convert the decimal number 12 into its binary equivalent.:solution = 12 = 8+4 = 2 ^{3}+2^{2}= 1×2 ^{3} + 1×2^{2} + 0×2^{1} +0×2^{0}= (1100)_{2} |

Q2). Convert the decimal number 25 into its binary equivalent.:solution = 25 = 16+8+1 = 2 ^{4}+2^{3}+2^{0}= 1×2 ^{4} + 1×2^{3} + 0×21×2^{2} + 0×2^{1} + ^{0}= (11001)_{2} |

Q3). Convert the decimal number 58 into its binary equivalent.:solution = 58 = 32 +16+8+2 = 2 ^{5}+2^{4}+2^{3}+2^{1}= 1×2 ^{5} + 1×2^{4} + 1×2^{3} + 0×2+ 1×2^{2} ^{1} + 0×2^{0}= (111010)_{2} |

Q4). Convert the decimal number 82 into its binary equivalent.:solution = 82 = 64 +16+2 = 2 ^{6}+2^{4}+2^{1}= 1×2 ^{6} + 0×2 + 1×2^{5}^{4} + 0×2+ 1×2^{3} + 0×2^{2} ^{1} + 0×2^{0}= (1010010)_{2} |

Q5). Convert the decimal number 125 into its binary equivalent.:solution = 125 = 64+32+16+8+4+1 = 2 ^{6}+2^{5}+2^{4}+2^{3}+2^{2}+2^{0}= 1×2 ^{6} + 1×2^{5} + 1×2^{4} + 1×2^{3} + 1×2^{2} + 0×2 + 1×2^{1}^{0}= (1111101)_{2} |

→ Binary to Hexadecimal Conversion: |

Q1). Convert 1100101001010111 into hexadecimal.:solution = 125 = 64+32+16+8+4+1 = 2 ^{6}+2^{5}+2^{4}+2^{3}+2^{2}+2^{0}= 1×2 ^{6} + 1×2^{5} + 1×2^{4} + 1×2^{3} + 1×2^{2} + 0×2 + 1×2^{1}^{0}= (1111101)_{2} |

Q5). Convert 11010101 into hexadecimal.:solution = 1101 0101 (Group the binary digits into sets of four)—— —— ↓ ↓D 5 = (D5)_{16} |

RoughWe have, 1101 0101= 1×2=13 5 → ^{3}+1×2^{2}+0x2^{1}+1×2^{0} 0x2^{3}+1×2^{2}+0x2^{1}+1×2^{0}(D is 13)= D5_{16} |

→ Hexadecimal to Binary Conversion: |

## Boolean Algebra and logic gates

#### 1. When a 1 is on the input of an inverter, what is the output?

**ans**: The output is 0.

#### 2. When is the output of an AND gate HIGH?

**ans**: The output of an AND gate is HIGH when all the inputs are HIGH (i.e. 1).

#### 3. When is the output of an AND gate LOW?

**ans**: The output of an AND gate is LOW when one or more inputs are LOW (i.e. 0).

#### 4. When is the output of an OR gate HIGH?

**ans**: The output of a OR gate is HIGH when one or more inputs are HIGH (i.e. 1).

#### 5. When is the output of an OR gate LOW?

**ans**: The output of a OR gate is LOW when all the inputs are LOW (i.e. 0).

#### 6. When is the output of a NAND gate HIGH?

**ans**: The output of a NAND gate is HIGH when one or more inputs are LOW (i.e. 0).

#### 7. When is the output of a NAND gate LOW?

**ans**: The output of a NAND gate is LOW when all the inputs are HIGH (i.e. 1).

#### 8. When is the output of a NOR gate HIGH?

**ans**: The output of a NOR gate is HIGH when all the inputs are LOW (i.e. 0).

#### 9. When is the output of a NOR gate LOW?

**ans**: The output of a NOR gate is LOW when one or more inputs are HIGH (i.e. 1).

#### 10. When is the output of a XOR gate HIGH?

**ans**: The output of a XOR gate is HIGH when the inputs are at opposite levels.

#### 11. When is the output of a XNOR gate HIGH?

**ans**: The output of a XNOR gate is HIGH when the inputs are at same level.