18.3 Number Systems, Logic Gates, Flowcharts & Computer Basics
Key Takeaways
- Decimal-to-binary conversion uses repeated division by 2, and binary digits group in threes for octal and fours for hexadecimal, so 77 in decimal is 1001101 in binary, 115 in octal and 4D in hexadecimal.
- The 2's complement of a binary number is its 1's complement plus 1, so -29 in an 8-bit register is stored as 11100011.
- NAND and NOR are universal gates, XOR outputs 1 only when its inputs differ, and XNOR outputs 1 only when its inputs match.
- Computer generations progressed from vacuum tubes to transistors, integrated circuits, VLSI microprocessors and artificial intelligence.
- In a relational database, the primary key uniquely identifies each record and cannot be NULL, while a foreign key refers to the primary key of another table.
18.3 Number Systems, Logic Gates, Flowcharts & Computer Basics
In the SBI Clerk Main Examination, the fourth test is Reasoning Ability & Computer Aptitude (50 questions, 60 marks, 45 minutes). The notification does not publish a separate question count for computer aptitude, so prepare its core topics: number-system conversions, binary arithmetic, logic gates, flowchart tracing, computer generations, database basics and common abbreviations, alongside the hardware, software, networking, security and MS Office topics in Sections 18.1 and 18.2.
Note: The Local Language Proficiency Test (LLPT) is not part of Computer Aptitude. Its pattern, exemption rule and qualifying requirement are covered in Section 1.4.
1. Positional Number Systems & Base Conversions
Modern digital computers process instructions through binary electronics. Understanding positional number systems involves identifying the base (or radix) representing the count of unique symbols utilized:
- Decimal System (Base 10): Standard human counting system utilizing ten distinct digits:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9. - Binary System (Base 2): Native computer architecture utilizing two states:
0(low voltage / off) and1(high voltage / on). - Octal System (Base 8): Compact notation utilizing eight digits:
0, 1, 2, 3, 4, 5, 6, 7. Each octal digit maps to a 3-bit binary group ($2^3 = 8$). - Hexadecimal System (Base 16): Alphanumeric notation utilizing sixteen symbols:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9followed byA(10),B(11),C(12),D(13),E(14), andF(15). Each hexadecimal digit maps to a 4-bit nibble ($2^4 = 16$).
| Decimal (Base 10) | Binary (Base 2) | Octal (Base 8) | Hexadecimal (Base 16) |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Step-by-Step Base Conversion Techniques
Technique A: Decimal to Binary (Successive Division by 2)
To convert a decimal integer to binary, divide repeatedly by the base (2) and record the integer remainders. Read remainders from the last division (Most Significant Bit - MSB) to the first (Least Significant Bit - LSB):
Worked Example: Convert Decimal $77_{10}$ to Binary:
Reading remainders bottom-to-top yields: $\mathbf{77_{10} = 1001101_2}$.
Technique B: Binary to Decimal (Positional Expansion)
Multiply each binary digit by its corresponding positional weight ($2^n$, starting with $n=0$ from the extreme right):
Technique C: Fast Binary to Octal & Hexadecimal Grouping
-
Binary to Octal: Partition binary bits into groups of 3 bits starting from the right (pad with leading zeros on the left if necessary) and write the decimal equivalent for each group:
-
Binary to Hexadecimal: Partition binary bits into groups of 4 bits starting from the right:
2. Binary Arithmetic & 2's Complement Representation
Binary Addition Mechanics
Binary addition follows four fundamental bit-level rules:
Carry: 1 1 1 1 1 1 1
1 0 1 1 0 1 1 (Decimal 91)
+ 0 1 1 0 1 1 1 (Decimal 55)
-----------------
1 0 0 1 0 0 1 0 (Decimal 146)
Every one of the seven columns produces a carry, and the final carry becomes the eighth bit of the answer: $91 + 55 = 146 = 10010010_2$.
Signed Integers: 1's Complement & 2's Complement
Modern CPU ALUs perform arithmetic subtraction through addition using 2's Complement Notation, eliminating the need for dedicated subtractor circuits and avoiding dual representations of zero (+0 and -0).
- Step 1 (Find 1's Complement): Invert every individual bit in the binary word (
0becomes1, and1becomes0). - Step 2 (Find 2's Complement): Add binary
1to the 1's complement result:
Worked Example: Represent negative decimal $-29$ in an 8-bit signed binary register:
- Express $+29$ as an 8-bit binary number:
00011101 - Compute 1's Complement (invert all bits):
11100010 - Add 1 to compute 2's Complement:
(Verification: The leftmost bit is 1, confirming a negative value. Weight: $-128 + 64 + 32 + 0 + 0 + 0 + 2 + 1 = -29$).
3. Digital Logic Gates & Master Truth Table
Digital logic gates are physical electronic circuits implementing fundamental Boolean logic functions:
AND GATE OR GATE NOT GATE
A ---+ A ---\ A ---|>o--- Y
)--- Y )--- Y (Inverter)
B ---+ B ---/
NAND GATE NOR GATE XOR GATE
A ---+ A ---\ A ---\ \
)o-- Y )o-- Y )--- Y
B ---+ B ---/ B ---/ /
- AND Gate ($Y = A \cdot B$): Yields output
1only if all inputs are1. - OR Gate ($Y = A + B$): Yields output
1if at least one input is1. - NOT Gate / Inverter ($Y = \overline{A}$): Unary operator that outputs the inverse of the input.
- NAND Gate ($Y = \overline{A \cdot B}$): Universal Gate. Inverted AND; yields output
0only when all inputs are1. - NOR Gate ($Y = \overline{A + B}$): Universal Gate. Inverted OR; yields output
1only when all inputs are0. - XOR Gate ($Y = A \oplus B = \overline{A}B + A\overline{B}$): Exclusive OR (Inequality Detector). Yields output
1when inputs are different; yields0when inputs are identical. - XNOR Gate ($Y = \overline{A \oplus B} = AB + \overline{A}\overline{B}$): Exclusive NOR (Equivalence Detector). Yields output
1when inputs are identical.
| Input A | Input B | AND ($A \cdot B$) | OR ($A + B$) | NAND ($\overline{A \cdot B}$) | NOR ($\overline{A + B}$) | XOR ($A \oplus B$) | XNOR ($\overline{A \oplus B}$) |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |
[!IMPORTANT] Universal Logic Gates: NAND and NOR are designated as Universal Gates because any Boolean function (AND, OR, NOT, XOR, XNOR) can be constructed exclusively from NAND gates or exclusively from NOR gates without requiring any other gate type.
4. Flowchart Aptitude & Coded Algorithm Questions
Flowchart questions test whether you can trace decisions and loops step by step without skipping a branch.
FLOWCHART SHAPE CONVENTIONS:
[ Start / Stop ] ===> Oval / Rounded Rectangle (Terminal)
/ Input / Output / ===> Parallelogram (Data I/O Operations)
[ Process ] ===> Rectangle (Arithmetic / Calculations)
< Decision > ===> Diamond (Conditional Branch: Yes/No)
| ===> Directed Arrow (Execution Flowline)
Worked Example 1: A Decision Flowchart
Consider this simple loan-screening flowchart:
[ START ]
|
v
/ Input: Age, Balance, Score /
|
v
< Is Age >= 21? > ----- No -----> [ REJECT ]
| Yes
v
< Is Score >= 700? > ---- Yes ----> [ APPROVE ]
| No
v
< Is Balance >= 50,000? > --- No -----> [ REJECT ]
| Yes
v
[ MANUAL REVIEW ]
Problem Scenario: An applicant has Age = 24, Balance = Rs. 65,000 and Score = 675.
- Decision 1: Is $24 \ge 21$? Yes, so move to Decision 2.
- Decision 2: Is $675 \ge 700$? No, so move to Decision 3.
- Decision 3: Is $65{,}000 \ge 50{,}000$? Yes.
- Outcome: The application goes to MANUAL REVIEW.
Worked Example 2: Tracing a Loop Counter
[ START ] --> [ Sum = 0, i = 1 ] --> < Is i <= 5? > -- No --> / Print Sum / --> [ STOP ]
| Yes
v
[ Sum = Sum + i x i ]
|
v
[ i = i + 2 ]
|
+----> back to "Is i <= 5?"
| Pass | Value of i at the decision | Is i <= 5? | Sum after the process box | i after the update |
|---|---|---|---|---|
| 1 | 1 | Yes | 0 + 1 = 1 | 3 |
| 2 | 3 | Yes | 1 + 9 = 10 | 5 |
| 3 | 5 | Yes | 10 + 25 = 35 | 7 |
| 4 | 7 | No | Loop ends | — |
Output: 35. The two usual errors are stopping one pass early (10) and adding one extra square (35 + 49 = 84). Write a trace table like this one for every loop question.
5. Generations of Computers
| Generation | Approximate period | Main technology | Characteristics | Examples |
|---|---|---|---|---|
| First | 1940s–1956 | Vacuum tubes | Very large, high power use and heat; machine language; punched cards and magnetic drums | ENIAC, EDVAC, UNIVAC I |
| Second | 1956–1963 | Transistors | Smaller, faster and more reliable; assembly language and early high-level languages such as FORTRAN and COBOL; magnetic core memory | IBM 1401, IBM 7094 |
| Third | 1964–1971 | Integrated circuits (ICs) | Keyboards, monitors and operating systems; multiprogramming | IBM System/360, PDP-8 |
| Fourth | 1971–present | Microprocessors built with VLSI | Personal computers, graphical user interfaces, networking and the internet | Intel 4004, IBM PC, Apple Macintosh |
| Fifth | Present and beyond | ULSI, parallel processing and artificial intelligence | Natural language processing, machine learning and voice recognition | AI systems and modern supercomputers |
Textbooks differ slightly on the year boundaries, so learn the technology that defines each generation.
Milestones Worth Remembering
- Charles Babbage designed the Analytical Engine in 1837 and is called the father of the computer; Ada Lovelace is often described as the first computer programmer.
- The transistor was invented at Bell Laboratories in 1947 by John Bardeen, Walter Brattain and William Shockley.
- The integrated circuit was developed independently by Jack Kilby (Texas Instruments, 1958) and Robert Noyce (Fairchild Semiconductor, 1959).
- The Intel 4004 (1971) was the first commercially available single-chip microprocessor.
- PARAM 8000, built by C-DAC in 1991, is regarded as India's first supercomputer.
Computers by Size and Power
- Supercomputers: the fastest machines, used for weather forecasting and scientific simulation.
- Mainframes: large systems that handle huge transaction volumes for many simultaneous users, such as a bank's central processing.
- Minicomputers: mid-sized multi-user systems.
- Microcomputers: personal computers, laptops, tablets and smartphones built around a microprocessor.
6. Database Management System (DBMS) Basics
A DBMS is software for storing, retrieving and managing data; a Relational DBMS (RDBMS) stores data in related tables. Examples include Oracle Database, MySQL, Microsoft SQL Server and PostgreSQL.
Relational Terms
| Term | Meaning | Banking example |
|---|---|---|
| Relation (table) | Data organised in rows and columns | CUSTOMER table |
| Tuple (record or row) | One entry in a table | One customer's details |
| Attribute (field or column) | One property of the entity | Customer_ID, Name, PAN |
| Degree | Number of attributes (columns) | A table with 6 columns has degree 6 |
| Cardinality | Number of tuples (rows) | A table with 10,000 customers has cardinality 10,000 |
| Domain | Set of allowed values for an attribute | Account type: Savings or Current |
Types of Keys
| Key | Definition | Example |
|---|---|---|
| Super key | Any set of attributes that uniquely identifies a record | {Customer_ID, Name} |
| Candidate key | A minimal super key; a table can have several | Customer_ID, or PAN |
| Primary key | The candidate key chosen as the main identifier; values must be unique and cannot be NULL | Customer_ID |
| Alternate key | A candidate key not chosen as the primary key | PAN |
| Foreign key | An attribute that refers to the primary key of another table, enforcing referential integrity; its values can repeat | Customer_ID stored in the ACCOUNT table |
| Composite key | A key made of two or more attributes together | {Account_No, Txn_No} |
SQL Command Categories
| Category | Purpose | Commands |
|---|---|---|
| DDL (Data Definition Language) | Defines or changes table structure | CREATE, ALTER, DROP, TRUNCATE |
| DML (Data Manipulation Language) | Changes the data in tables | INSERT, UPDATE, DELETE |
| DQL (Data Query Language) | Retrieves data; often grouped with DML | SELECT |
| DCL (Data Control Language) | Grants or removes access rights | GRANT, REVOKE |
| TCL (Transaction Control Language) | Manages transactions | COMMIT, ROLLBACK, SAVEPOINT |
DELETE removes selected rows and can be rolled back before a commit; TRUNCATE removes all rows and is treated as DDL; DROP removes the table itself.
ACID Properties of a Transaction
Take a transfer of Rs. 5,000 from Account A to Account B:
- Atomicity: The debit to A and the credit to B both happen, or neither does.
- Consistency: The database moves from one valid state to another; the combined balance stays the same.
- Isolation: Simultaneous transactions do not interfere with each other.
- Durability: Once committed, the transfer survives a system crash or power failure.
7. Character Codes and High-Frequency Abbreviations
- ASCII is a 7-bit code with 128 characters; extended ASCII uses 8 bits for 256 characters.
- EBCDIC is an 8-bit character code developed by IBM for its mainframes.
- Unicode assigns a unique code to characters across the world's writing systems, including Indian scripts.
| Abbreviation | Full form |
|---|---|
| ASCII | American Standard Code for Information Interchange |
| EBCDIC | Extended Binary Coded Decimal Interchange Code |
| BIOS | Basic Input/Output System |
| CMOS | Complementary Metal-Oxide-Semiconductor |
| GUI | Graphical User Interface |
| URL | Uniform Resource Locator |
| HTML | HyperText Markup Language |
| ISP | Internet Service Provider |
| VPN | Virtual Private Network |
| MODEM | Modulator-Demodulator |
| SQL | Structured Query Language |
| IoT | Internet of Things |
| SaaS / PaaS / IaaS | Software / Platform / Infrastructure as a Service |
| CAPTCHA | Completely Automated Public Turing test to tell Computers and Humans Apart |
| UPS | Uninterruptible Power Supply |
| USB | Universal Serial Bus |
| COBOL | Common Business-Oriented Language |
| FORTRAN | Formula Translation |
Common Traps
- Octal groups binary digits in threes; hexadecimal groups them in fours.
- 2's complement is the 1's complement plus 1.
- NAND and NOR are universal gates; XOR and XNOR are not.
- A foreign key can repeat and can be NULL; a primary key can do neither.
TRUNCATEis DDL, whileDELETEis DML.
What is the equivalent binary representation of the decimal integer 77?
Which of the following logic gate pairs are universally recognized as 'Universal Logic Gates' because any Boolean function can be implemented using exclusively either of them?
In a bank's CUSTOMER table, which key is chosen to uniquely identify each record and cannot contain NULL values?
Which technology defines the fourth generation of computers?
A flowchart sets S = 0 and N = 2, then repeats two steps, S = S + N followed by N = N + 3, until N > 12, and finally prints S. What value is printed?
You've completed this section
Continue exploring other exams