Number Systems & Logic Gates
Whether you're sending an eSewa payment or playing PUBG, underneath it all, your computer is just processing 0s and 1s. To understand how computers work in Grade 11 Computer Science, we start with the absolute basics of how they represent data and make decisions.
Number Systems: Speaking the Computer's Language
We naturally use the Decimal (Base-10) system because we have 10 fingers. It uses digits 0-9. But computers use switches that are either ON or OFF, so they use other bases:
- Binary (Base-2): Uses only 0 and 1. The foundation of all computing. For example, the decimal number 9 is written as
1001in binary. - Octal (Base-8): Uses digits 0-7. Historically useful for grouping 3 binary digits together.
- Hexadecimal (Base-16): Uses 0-9 and A-F (where A=10, B=11... F=15). Widely used in memory addresses and web colors (like
#FFFFFFfor white). It cleanly groups 4 binary digits into a single character.
Conversion Tip: To convert Decimal to Binary, you repeatedly divide by 2 and write down the remainders from bottom to top!
Logic Gates: The Brain's Building Blocks
If number systems are the vocabulary, logic gates are the grammar. They take binary inputs (Voltage HIGH = 1, Voltage LOW = 0) and produce a single binary output based on simple rules.
- AND Gate: Output is 1 only if BOTH inputs are 1. Think of it like a safety deposit box that requires two keys to open.
- OR Gate: Output is 1 if AT LEAST ONE input is 1. Like a house with two doors—if either is unlocked, you can enter.
- NOT Gate (Inverter): Has only one input. It flips it! If input is 1, output is 0.
The Universal Gates
- NAND Gate: An AND gate followed by a NOT gate. Outputs 0 only if both inputs are 1.
- NOR Gate: An OR gate followed by a NOT gate. Outputs 1 only if both inputs are 0.
NAND and NOR are called Universal Gates because you can build any other gate just by combining them. In the real world, hardware manufacturers like Intel or AMD use millions of these tiny gates combined into Integrated Circuits (ICs) to build processors that power your laptops and smartphones.
Quick Quiz
1. What is the decimal number 10 in binary?
2. Which of the following numbers is valid in the Octal number system?
3. If an AND gate has inputs A=1 and B=0, what is the output?
4. Why is the NAND gate called a Universal Gate?