Class 11 Computer Science Chapter 2 Complete Notes | NEB

 


Chapter 2
NUMBER SYSTEMS CONVERSION AND BOOLEAN LOGIC

 

What is number system?
Number systems are the technique to represent numbers in the computer system architecture, every value that you are saving or getting into/from computer memory has a defined number system. 

Positional number system
in positional number system each symbol represent different value depending on the position the occupy in a number, and each system has a value that relates to the number directly next to it.
The following table shows a summary of the four positional number system with used symbols and examples;

System

Base

Symbols

Examples

Decimal

10

0, 1, 2, 3, 4, 5, 6, 7, 8, 9

4365.52

Binary

2

0, 1

(1101.11)2

Octal

8

0, 1, 2, 3, 4, 5, 6, 7

(145.23)8

Hexadecimal

16

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

(A2C.A1)16

 

Non positional number system
the non-positional number system consists of different symbols that are used to represent numbers. A Roman number system is an example of the non-positional number system i.e. I=1, V=5, X=10, L=50.
 
Decimal number system
In the decimal number system, the numbers are represented with base 10. The way of denoting the decimal numbers with base 10 is also termed as decimal notation. This number system is widely used in computer applications. It is also called the base-10 number system which consists of 10 digits.

Binary Number System
A Binary number system has only two digits that are 0 and 1. Every number (value) represents with 0 and 1 in this number system. The base of binary number system is 2, because it has only two digits.

Octal Number System
Octal number system has only eight (8) digits from 0 to 7. Every number (value) represents with 0,1,2,3,4,5,6 and 7 in this number system. The base of octal number system is 8, because it has only 8 digits.

Hexadecimal Number System
A Hexadecimal number system has sixteen (16) alphanumeric values from 0 to 9 and A to F. Every number (value) represents with 0,1,2,3,4,5,6, 7,8,9,A,B,C,D,E and F in this number system. The base of hexadecimal number system is 16, because it has 16 alphanumeric values. Here A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15.

 The 9’s and 10’s complement Decimal Subtraction

Subtraction using 9’s complement method

Rules

1) Make equal number of digits in both subtrahend and minuend.
2) Find 9’s complement of subtrahend.
3) Add the 9’s complement of subtrahend with minuend.
4) Check for carry digit

 4.1. If there is carry digit, answer will be positive and obtained by adding carry digit to last sum without carry digit. (Case of subtracting from larger to smaller one)
4.2. If there is no carry digit, answer will be negative and in 9's complement form of last sum Le. find 9’s complement of last sum and prefix negative sign to final result. (Case of subtracting from smaller to larger one)

 

Subtraction using 10’s complement method

Rules:

1) Make equal number of digits in both subtrahend and minuend.
2) Find 10’s complement of Subtrahend.
3) Add the 10’s complement of subtrahend with minuend.
4) Check for carry digit

4.1) if there is carry digit or extra digit; answer will be positive and obtained by ignoring carry digit. (Case of subtracting from larger to smaller one)
4.2) If there is no carry digit, answer will be negative and in 10’s complement form of last sum. I.e. find 10’s complement of last sum and prefix negative sign to get final result. (Case of subtracting from smaller to larger one)

 

 

Subtracting using 1’s complement method

Rules:

(1) Make equal number of bits in both subtrahend and minuend.
(2) Find 1’s complement of subtrahend.
(3) Add the 1’s complement of subtrahend with minuend.
(4) Check for carry bit

4.1) If there is carry bit, answer will be positive and obtained by adding carry bit to last sum without carry bit. (Case of subtracting from larger to smaller one)
4.2) If there is no carry bit, answer will be negative and in 1’s complement form of last sum. i.e. find 1’s complement of last sum and prefix negative sign to final get result. (Case of subtracting from smaller to larger one)

 

Subtraction using 2’s complement method

Rules:

(1) Make equal number of bits in both subtrahend and minuend.
(2) Find 2’s complement of subtrahend.
(3) Add the 2’s complement of subtrahend with minuend.
(4) Check for carry bit or extra bit

(41). If there is carry bit or extra bit, answer will be positive and obtained by ignoring carry bit (Case of subtracting from larger to smaller one)
4.2). If there is no carry bit, answer will be negative and in 2’s complement form of last sum, i.e. find 2’s complement of last sum and prefix negative sign to get final result. (Case of subtracting from smaller to larger one)

 

BOOLEAN ALGEBRA AND LOGIC FUNCTION
Boolean algebra is the branch of mathematics that deals with the study of Boolean Variable, Boolean operation and binary number 1 and 0 .

Boolean algebra: It is algebra of logic which could accept either of the possible two values 0 and 1 and generate a result through logical relationship and operation.

Boolean variable: Those entities which has either or 0 and 1 and denote some specific operation ore known as Boolean variable. Simply, it is an entity in Boolean algebra which has only either of the two possible values. This variable are denoted by A, B, P, Q, X, Y, Z….

Boolean function (logic functions): Boolean function is an expression formed by binary variables, binary operators such as AND, OR, NOT, parentheses, and equal sign for a given set of value this Boolean function gives the 0 or 1 as a result.

 Differences between Boolean algebra and Ordinary algebra

Boolean algebra

Ordinary algebra

1. Boolean algebra has only finite set of elements, namely 0 and 1.

1. Ordinary algebra deals with a set of infinite number of elements.

2. It supports only + operators and does not support subtraction and division operations.

2. it supports all of the operations.

3. In Boolean algebra there are no coefficients or exponents involved i.e., x+x=x and x.x=x.

3. It supports exponents and coefficients.

4. In Boolean algebra the distributive law of + over. is x+(y.z)=(x+y).(x+z)

4. It doesn’t support that type of distributive law but the distributive law is x+(y.z)=x+yz.

 

Truth Table
a truth table is a table of all possible combination of the variables showing the relation between the values the variables may take and the result of the operation.

Venn Diagram
a Venn diagram is a graphical representation of common relationship shared by different states, and is made for arrangements of intersecting closed curves in a plan (or possibly its generalization to higher dimensional surfaces).

Logic Gates (Gates)
a logic gate is an electronic circuit that operates on one or more input signals to produce an output signal. Logic gates are the basic building blocks of any digital system. Digital computers use different types of logic gate. Each gate have a specific function & graphical symbols.
in digital computer there are three types of basic gate which are;

1.      AND gate

2.      OR gate

3.      NOT gate

There are two Universal gates;

1.      NAND gate

2.      NOR gate

There are two Derived gates

1.      XOR gate

2.      XNOR gate

 

Basic Gate
(1) AND gate
It is an electronic circuit, which produce high logic (1) output when both the input logic are high (1) and produce low logic (0) when any one of the input logic is low (0). The output produce by this basic gate is the product of its input logic.
The graphical symbol, truth table and Venn diagram for AND gate with two input are snow below.

                           
Graphical Symbol of AND                                                  Venn diagram: A.B

A

B

F=A.B

0

0

0

0

1

0

1

0

0

1

1

1

  Truth Table; A.B

 

(2) OR Gate  
It is an electronic circuit, which produce high logic (1) output when any one of the input logic are high (1) and produce low logic(0) when both the input logic is low (0). The output produce by this basic gate is the sum of its input logic.

                              

Graphical Symbol of OR gate                                                          Venn diagram; A.B

A

B

F=A+B

0

0

0

0

1

1

1

0

1

1

1

1

        Truth table

(3) NOT Gate
It is an electronic circuit, which produce high logic (1) output when the input logic is low (0) and produce low logic(0) when the input logic is high (1). The output produce by this basic gate is the reciprocal of its input logic.

                               

                      Graphical symbol                                                                   Venn diagram

A

F=A’

0

1

1

0

Truth Table

 

(4)  NAND Gate
It is the combination of NOT and AND gate, which produce high logic (1) output when any one of the input logic is low (0) and produce low logic(0) when both the input logic is high (1). The output produce by this basic gate is the reciprocal or complement of AND gate. It is also known as derived gate.


             Graphical Symbol of NAND gate                                          Venn Diagram

A

B

A+B

F=(A+B)”

0

0

0

1

0

1

1

0

1

0

1

0

1

1

1

0

Truth Table

 

(5) NOR Gate

It is the combination of NOT and OR gate, which produce high logic (1) output when both the input logic is low (0) and produce low logic(0) when any one of the input logic is high (1). The output produce by this basic gate is the reciprocal or complement of OR gate. It is also known as derived gate.

                         

 

Graphical neither Symbol of NOR Gate                                       Venn diagram

A

B

F=A+B

F=(A+B)’

0

0

0

1

0

1

1

0

1

0

1

0

1

1

1

0

Truth Table

 

(6)  Exclusive OR (X-OR) Gate

It is derived gate, which produce low logic (0) output when both the input logic are either high (1) or low (0) otherwise it will produce high logic (1).

                   

       Graphical Symbol                                                                            Venn diagram

A

B

A’

B’

A’.B

A.B’

A’.B+A.B’

0

0

1

1

0

0

0

0

1

1

0

1

0

1

1

0

0

1

0

1

1

1

1

0

0

0

0

0

Truth Table

 

(7) Exclusive-NOR (X-NOR) Gate

It is derived gate, which produce high logic (1) output when both the input logic are either high (1) or low (0) otherwise it will produce low logic(0).

                          

Graphical Symbol                                                                                    Venn diagram

A

B

A’

B’

A.B

A’.B’

A’.B+A.B’

0

0

1

1

0

1

1

0

1

1

0

0

0

0

1

0

0

1

0

0

0

1

1

0

0

1

0

1

Truth table

 

NAND and NOR gates are called universal gate because using only NAND or only NOR gates we can realize all three basic operation.

DE Morgan’s Theorem

First Theorem: The De-Morgan's first theorem states that, “The complement of a sum equals to the product of its complement.”

It is represented as: (A+B)' = A'.B''

Graphical symbol

Proof:

A

B

A’

B'

A+B

(A+B)'

A'.B'

0

0

1

1

0

1

1

0

1

1

0

1

0

0

1

0

0

1

1

0

0

1

1

0

0

1

0

0

Second Theorem: The De-Morgan's second theorem states that, “The complement of a product equals to the sum of its complement.”

It is represented as: (A.B)' = A'+B''

Graphical symbol

Proof:

A

B

A’

B'

A.B

(A.B)'

A'+B'

0

0

1

1

0

1

1

0

1

1

0

0

1

1

1

0

0

1

0

0

1

1

1

0

0

1

0

0

COMPARING VALUES OF (A.B’) AND A’+B’ FROM TRUTH TABLE, BOTH ARE EQUAL. HENCE PROVED.


No comments:

Powered by Blogger.