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.
Last updated: September 2026

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:

  1. Decimal System (Base 10): Standard human counting system utilizing ten distinct digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
  2. Binary System (Base 2): Native computer architecture utilizing two states: 0 (low voltage / off) and 1 (high voltage / on).
  3. 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$).
  4. Hexadecimal System (Base 16): Alphanumeric notation utilizing sixteen symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 followed by A (10), B (11), C (12), D (13), E (14), and F (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)
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

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:

77÷2=38Remainder: 1(LSB)77 \div 2 = 38 \quad \text{Remainder: } 1 \quad (\text{LSB}) 38÷2=19Remainder: 038 \div 2 = 19 \quad \text{Remainder: } 0 19÷2=9Remainder: 119 \div 2 = 9 \quad \text{Remainder: } 1 9÷2=4Remainder: 19 \div 2 = 4 \quad \text{Remainder: } 1 4÷2=2Remainder: 04 \div 2 = 2 \quad \text{Remainder: } 0 2÷2=1Remainder: 02 \div 2 = 1 \quad \text{Remainder: } 0 1÷2=0Remainder: 1(MSB)1 \div 2 = 0 \quad \text{Remainder: } 1 \quad (\text{MSB})

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):

10011012=(1×26)+(0×25)+(0×24)+(1×23)+(1×22)+(0×21)+(1×20)1001101_2 = (1 \times 2^6) + (0 \times 2^5) + (0 \times 2^4) + (1 \times 2^3) + (1 \times 2^2) + (0 \times 2^1) + (1 \times 2^0) =64+0+0+8+4+0+1=7710= 64 + 0 + 0 + 8 + 4 + 0 + 1 = \mathbf{77_{10}}

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:

    001100111015    1158\underbrace{001}_{1} \quad \underbrace{001}_{1} \quad \underbrace{101}_{5} \implies \mathbf{115_8}

  • Binary to Hexadecimal: Partition binary bits into groups of 4 bits starting from the right:

    01004110113=D    4D16\underbrace{0100}_{4} \quad \underbrace{1101}_{13 = D} \implies \mathbf{4D_{16}}


2. Binary Arithmetic & 2's Complement Representation

Binary Addition Mechanics

Binary addition follows four fundamental bit-level rules:

0+0=00 + 0 = 0 0+1=10 + 1 = 1 1+0=11 + 0 = 1 1+1=0(with a Carry of 1 into the next higher column)1 + 1 = 0 \quad (\text{with a Carry of } 1 \text{ into the next higher column}) 1+1+1=1(with a Carry of 1 into the next higher column)1 + 1 + 1 = 1 \quad (\text{with a Carry of } 1 \text{ into the next higher column})

  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 (0 becomes 1, and 1 becomes 0).
  • Step 2 (Find 2's Complement): Add binary 1 to the 1's complement result:

2’s Complement=(1’s Complement)+1\mathbf{\text{2's Complement} = (\text{1's Complement}) + 1}

Worked Example: Represent negative decimal $-29$ in an 8-bit signed binary register:

  1. Express $+29$ as an 8-bit binary number: 00011101
  2. Compute 1's Complement (invert all bits): 11100010
  3. Add 1 to compute 2's Complement:

11100010+00000001111000112\begin{array}{rl} & 11100010 \\ + & 00000001 \\ \hline & \mathbf{11100011}_2 \end{array}

(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 ---/ /
  1. AND Gate ($Y = A \cdot B$): Yields output 1 only if all inputs are 1.
  2. OR Gate ($Y = A + B$): Yields output 1 if at least one input is 1.
  3. NOT Gate / Inverter ($Y = \overline{A}$): Unary operator that outputs the inverse of the input.
  4. NAND Gate ($Y = \overline{A \cdot B}$): Universal Gate. Inverted AND; yields output 0 only when all inputs are 1.
  5. NOR Gate ($Y = \overline{A + B}$): Universal Gate. Inverted OR; yields output 1 only when all inputs are 0.
  6. XOR Gate ($Y = A \oplus B = \overline{A}B + A\overline{B}$): Exclusive OR (Inequality Detector). Yields output 1 when inputs are different; yields 0 when inputs are identical.
  7. XNOR Gate ($Y = \overline{A \oplus B} = AB + \overline{A}\overline{B}$): Exclusive NOR (Equivalence Detector). Yields output 1 when inputs are identical.
Input AInput BAND ($A \cdot B$)OR ($A + B$)NAND ($\overline{A \cdot B}$)NOR ($\overline{A + B}$)XOR ($A \oplus B$)XNOR ($\overline{A \oplus B}$)
00001101
01011010
10011010
11110001

[!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.

  1. Decision 1: Is $24 \ge 21$? Yes, so move to Decision 2.
  2. Decision 2: Is $675 \ge 700$? No, so move to Decision 3.
  3. Decision 3: Is $65{,}000 \ge 50{,}000$? Yes.
  4. 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?"
PassValue of i at the decisionIs i <= 5?Sum after the process boxi after the update
11Yes0 + 1 = 13
23Yes1 + 9 = 105
35Yes10 + 25 = 357
47NoLoop 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

GenerationApproximate periodMain technologyCharacteristicsExamples
First1940s–1956Vacuum tubesVery large, high power use and heat; machine language; punched cards and magnetic drumsENIAC, EDVAC, UNIVAC I
Second1956–1963TransistorsSmaller, faster and more reliable; assembly language and early high-level languages such as FORTRAN and COBOL; magnetic core memoryIBM 1401, IBM 7094
Third1964–1971Integrated circuits (ICs)Keyboards, monitors and operating systems; multiprogrammingIBM System/360, PDP-8
Fourth1971–presentMicroprocessors built with VLSIPersonal computers, graphical user interfaces, networking and the internetIntel 4004, IBM PC, Apple Macintosh
FifthPresent and beyondULSI, parallel processing and artificial intelligenceNatural language processing, machine learning and voice recognitionAI 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

TermMeaningBanking example
Relation (table)Data organised in rows and columnsCUSTOMER table
Tuple (record or row)One entry in a tableOne customer's details
Attribute (field or column)One property of the entityCustomer_ID, Name, PAN
DegreeNumber of attributes (columns)A table with 6 columns has degree 6
CardinalityNumber of tuples (rows)A table with 10,000 customers has cardinality 10,000
DomainSet of allowed values for an attributeAccount type: Savings or Current

Types of Keys

KeyDefinitionExample
Super keyAny set of attributes that uniquely identifies a record{Customer_ID, Name}
Candidate keyA minimal super key; a table can have severalCustomer_ID, or PAN
Primary keyThe candidate key chosen as the main identifier; values must be unique and cannot be NULLCustomer_ID
Alternate keyA candidate key not chosen as the primary keyPAN
Foreign keyAn attribute that refers to the primary key of another table, enforcing referential integrity; its values can repeatCustomer_ID stored in the ACCOUNT table
Composite keyA key made of two or more attributes together{Account_No, Txn_No}

SQL Command Categories

CategoryPurposeCommands
DDL (Data Definition Language)Defines or changes table structureCREATE, ALTER, DROP, TRUNCATE
DML (Data Manipulation Language)Changes the data in tablesINSERT, UPDATE, DELETE
DQL (Data Query Language)Retrieves data; often grouped with DMLSELECT
DCL (Data Control Language)Grants or removes access rightsGRANT, REVOKE
TCL (Transaction Control Language)Manages transactionsCOMMIT, 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.
AbbreviationFull form
ASCIIAmerican Standard Code for Information Interchange
EBCDICExtended Binary Coded Decimal Interchange Code
BIOSBasic Input/Output System
CMOSComplementary Metal-Oxide-Semiconductor
GUIGraphical User Interface
URLUniform Resource Locator
HTMLHyperText Markup Language
ISPInternet Service Provider
VPNVirtual Private Network
MODEMModulator-Demodulator
SQLStructured Query Language
IoTInternet of Things
SaaS / PaaS / IaaSSoftware / Platform / Infrastructure as a Service
CAPTCHACompletely Automated Public Turing test to tell Computers and Humans Apart
UPSUninterruptible Power Supply
USBUniversal Serial Bus
COBOLCommon Business-Oriented Language
FORTRANFormula 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.
  • TRUNCATE is DDL, while DELETE is DML.
Loading diagram...
Number System Conversion Pathways
Test Your Knowledge

What is the equivalent binary representation of the decimal integer 77?

A
B
C
D
Test Your Knowledge

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?

A
B
C
D
Test Your Knowledge

In a bank's CUSTOMER table, which key is chosen to uniquely identify each record and cannot contain NULL values?

A
B
C
D
Test Your Knowledge

Which technology defines the fourth generation of computers?

A
B
C
D
Test Your Knowledge

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?

A
B
C
D
Congratulations!

You've completed this section

Continue exploring other exams