Chapter 2: Number System and Logic Functions
Computer Science - Class 11
No MCQ questions available for this chapter.
Chapters
- Chapter 1: Introduction of Computer
- Chapter 2: Number System and Logic Functions
- Chapter 3: Software and Operating Systems
- Chapter 4: Application Software and Domain-Specific Tools
- Chapter 5: Programming Concepts and the C Programming Language
- Chapter 6: Web Development and HTML
- Chapter 7: Multimedia
- Chapter 8: Digital Society and Ethics
Chapter 2: Number System and Logic Functions
2.1 Number System and Conversion
2.1.1 Decimal, Binary, Octal, Hexadecimal Number System & Conversion
Number Systems:
Decimal (Base 10):
- Uses digits 0-9.
- Each position represents a power of 10 (e.g., ).
- Conversion: To convert from decimal to binary, octal, or hexadecimal, divide the number by the base and record the remainders.
Binary (Base 2):
- Uses digits 0 and 1.
- Each position represents a power of 2 (e.g., ).
- Conversion: Decimal to binary involves dividing by 2 and noting remainders.
Octal (Base 8):
- Uses digits 0-7.
- Each position represents a power of 8 (e.g., ).
- Conversion: Decimal to octal is similar to binary but with base 8.
Hexadecimal (Base 16):
- Uses digits 0-9 and letters A-F (A=10, B=11, C=12, D=13, E=14, F=15).
- Each position represents a power of 16 (e.g., ).
- Conversion: Decimal to hexadecimal involves dividing by 16.
2.1.2 Calculation in Binary: Addition and Subtraction
Binary Addition:
Rules:
- (carry 1 to the next higher bit)
- (carry 1 to the next higher bit)
Example:
Binary Subtraction:
- Rules:
- : requires borrowing.
- Example:
- Rules:
2.1.3 One’s and Two’s Complement Methods of Binary Subtraction
One’s Complement:
- Involves flipping all bits (0s become 1s and vice versa).
- Example: One’s complement of is .
Two’s Complement:
- One’s complement plus one.
- Used for binary subtraction.
- Example: Two’s complement of :
- One’s complement:
- Adding one: (Two’s complement = ).
Subtraction Example:
- To subtract , convert to its two’s complement and add it to .
- If there's a carry, discard it.
2.2 Logic Function and Boolean Algebra
2.2.1 Introduction to Boolean Algebra
- Boolean Algebra:
- A branch of algebra that involves binary variables and logical operations.
- Fundamental to digital circuits and computer logic.
- Uses two values: True (1) and False (0).
2.2.2 Introduction to Boolean Values, Truth Table, Boolean Expression, and Boolean Function
Boolean Values: Represent logical statements as either true (1) or false (0).
Truth Table: A table that lists all possible values of variables and the corresponding output of a Boolean expression.
- Example: Truth table for AND :
A B A AND B 0 0 0 0 1 0 1 0 0 1 1 1
- Example: Truth table for AND :
Boolean Expression: Represents a logical relationship using variables and operators (AND, OR, NOT).
- Example: represents OR .
Boolean Function: A function that takes Boolean inputs and produces a Boolean output.
2.2.3 Logic Gates
AND Gate:
- Definition: Outputs true only if all inputs are true.
- Truth Table:
A B A AND B 0 0 0 0 1 0 1 0 0 1 1 1 - Logic Symbol:
OR Gate:
- Definition: Outputs true if at least one input is true.
- Truth Table:
A B A OR B 0 0 0 0 1 1 1 0 1 1 1 1 - Logic Symbol:
NOT Gate:
- Definition: Outputs the opposite of the input.
- Truth Table:
A NOT A 0 1 1 0 - Logic Symbol:
NAND Gate:
- Definition: Outputs false only if all inputs are true.
- Truth Table:
A B A NAND B 0 0 1 0 1 1 1 0 1 1 1 0 - Logic Symbol:
NOR Gate:
- Definition: Outputs true only if all inputs are false.
- Truth Table:
A B A NOR B 0 0 1 0 1 0 1 0 0 1 1 0 - Logic Symbol:
XOR Gate:
- Definition: Outputs true if the inputs are different.
- Truth Table:
A B A XOR B 0 0 0 0 1 1 1 0 1 1 1 0 - Logic Symbol:
XNOR Gate:
- Definition: Outputs true if the inputs are the same.
- Truth Table:
A B A XNOR B 0 0 1 0 1 0 1 0 0 1 1 1 - Logic Symbol:
2.2.4 Laws of Boolean Algebra
- Boolean Identities:
- Complement Laws:
- Identity Laws:
- Commutative Laws:
- Associative Laws:
- Distributive Law:
- Complement Laws:
2.2.5 Statement and Verification of Laws of Boolean Algebra Using Truth Table
Verification:
- Truth tables can be constructed for both sides of the equation for each law to confirm their validity.
Example: Verification of the Commutative Law:
For and :
A B A + B B + A 0 0 0 0 0 1 1 1 1 0 1 1 1 1 1 1
Both outputs match, proving .