Menu
Home
CUET UG
CUET Home Subjects Notes Quizzes Solutions Mock Tests Blog
OPSC
All Odisha exams OPSC Home OAS Preparation Question Papers Syllabus Practice MCQs Optional Subjects
Ask a Query
📱 Download BYTE App
About Contact Privacy
Home MCQs App

Number System, Codes & Logic Gates: Notes and 101 Practice MCQs

3 min read

Binary, octal, decimal and hexadecimal numbers and conversions, binary arithmetic and complements, ASCII/Unicode codes, and logic gates.

On this page

    Practise 101 questions on this topic
    Learn mode or test mode, with explanations
    Start →

    Number systems

    SystemBase (radix)Digits used
    Binary20, 1
    Octal80–7
    Decimal100–9
    Hexadecimal160–9 and A(10), B(11), C(12), D(13), E(14), F(15)

    Computers use binary because electronic circuits have two stable states (ON = 1, OFF = 0). The value of a digit depends on its position (place value = baseposition).

    Conversions

    Decimal → any base

    Divide repeatedly by the base and write the remainders from bottom to top. Example: 25 → binary: 25/2 = 12 r1, 12/2 = 6 r0, 6/2 = 3 r0, 3/2 = 1 r1, 1/2 = 0 r1 → 11001.

    For a decimal fraction, multiply by the base and take the integer parts from top to bottom: 0.625 × 2 = 1.25 → 1; 0.25 × 2 = 0.5 → 0; 0.5 × 2 = 1.0 → 1 → 0.101.

    Any base → decimal

    Multiply each digit by its place value and add. 1011012 = 32 + 0 + 8 + 4 + 0 + 1 = 45. 1A16 = 1×16 + 10 = 26. 178 = 1×8 + 7 = 15.

    Binary ↔ octal / hexadecimal (shortcut)

    Group binary digits from the right: 3 bits = 1 octal digit, 4 bits = 1 hex digit. 1101012 → 110 101 → 658. 110101102 → 1101 0110 → D616.

    DecimalBinaryOctalHex
    81000108
    10101012A
    15111117F
    16100002010
    25511111111377FF

    Binary arithmetic

    Character codes

    Logic gates and Boolean algebra

    Logic gates are electronic circuits that work on binary inputs. Boolean algebra was developed by George Boole.

    GateOutput is 1 when…Symbol
    ANDall inputs are 1A·B
    ORat least one input is 1A+B
    NOT (inverter)input is 0 (one input only)A′ or Ā
    NANDNOT of AND – output 0 only when all inputs are 1(A·B)′
    NORNOT of OR – output 1 only when all inputs are 0(A+B)′
    XORinputs are differentA⊕B
    XNORinputs are the sameA⊙B

    NAND and NOR are universal gates – any other gate can be built using only NAND (or only NOR). A two-input gate has 2² = 4 rows in its truth table; n inputs give 2n rows.

    De Morgan's laws: (A+B)′ = A′·B′ and (A·B)′ = A′+B′. Other rules: A+0 = A, A·1 = A, A+A = A, A·A′ = 0, A+A′ = 1.

    Quick recall: base 2/8/10/16 · 3 bits = 1 octal digit · 4 bits = 1 hex digit · F = 15 · ASCII 7-bit, 128 chars · Unicode covers all scripts · NAND, NOR universal · XOR = 1 when inputs differ.

    OPSC ASO exam guide Odisha Police SI & Constable (OUSSSC) prep Previous: Computer Memory & Storage Next: Computer Software

    Sourced from the Odisha Public Service Commission where applicable. opsc.gov.in. EduSaint is not affiliated with OPSC.