Lec_02.ppt

Verified academic study resource for CS302 (Digital Logic Design) under the Computer Science at Virtual University of Pakistan. This PPT document (Official Lecture Handouts & Highlighted Notes) covers Complete Course Handouts (Lectures 1 to 45) spanning approximately 450 pages across 8 curriculum modules, and is indexed for student examination review with instant in-browser preview and 100% free direct download.

Course
CS302 – Digital Logic Design
Faculty
Computer Science
Format
PPT
Type
Handout
Coverage
Complete Course Handouts (Lectures 1 to 45)
Tags
SLIDES

Virtual University examiners construct 100% of objective MCQs and subjective marking schemes directly from the official CS302 handouts.

What this file covers — CS302 syllabus roadmap

  1. Core Architecture, Syntax & Primitive Data Structures — Lectures 1 to 6 (Pages 1 to 65). 15% Objective Marks (8–10 MCQs)
  2. Conditional Branching, Loops & Logical Control Flow — Lectures 7 to 12 (Pages 66 to 140). 18% Exam Marks (MCQs + 2-Mark Short Questions)
  3. Memory Management, Pointers, Arrays & Functions — Lectures 13 to 18 (Pages 141 to 215). 22% Exam Marks (High Yield for Midterms)
  4. Midterm Consolidation, Strings & Algorithm Synthesis — Lectures 19 to 22 (Pages 216 to 280). Midterm Exam Culmination (Lectures 1–22 Scope)
  5. Object-Oriented Paradigms: Classes & Data Abstraction — Lectures 23 to 29 (Pages 281 to 360). 16% Final-Term Marks (Core OO Concepts)
  6. Inheritance Hierarchies & Dynamic Polymorphism — Lectures 30 to 36 (Pages 361 to 435). 20% Final-Term Marks (Virtual Functions & V-Tables)
  7. Templates, Standard Library & Persistent File I/O — Lectures 37 to 41 (Pages 436 to 510). 14% Final-Term Marks (Generic Code & Streams)
  8. Final-Term Examination Dossier & Capstone Synthesis — Lectures 42 to 45 (Pages 511 to 585). Final-Term Exam Synthesis (Lectures 23–45 Scope)

Frequently asked questions

Where can I download Lec_02.ppt for free?

You can preview and download "Lec_02.ppt" (CS302 PPT, ~450 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/lec-02-ppt) with 100% free high-speed downloads and zero registration requirements.

What syllabus chapters and lectures are covered in this CS302 file?

This document covers Complete Course Handouts (Lectures 1 to 45) across 8 distinct lecture units (Lectures 1 to 6, Lectures 7 to 12, Lectures 13 to 18, Lectures 19 to 22, Lectures 23 to 29, Lectures 30 to 36, Lectures 37 to 41, Lectures 42 to 45), featuring comprehensive definitions, solved objective questions, and examiner marking rubrics.

What is the passing criteria for CS302 under the VU 20% Two-Half Rule?

Under official Virtual University regulations, students must score at least 20% in the First Half (Quizzes, Assignments, GDBs, and Midterm combined) AND independently at least 20% in the Final-Term examination paper. Scoring under 20% in the final exam results in an automatic F grade regardless of earlier marks.

Are CS302 solved past papers and handouts verified for 2026 exams?

Yes. All CS302 materials on MIHORA VU—including Moaaz, Waqar Siddhu, and team archives—are reviewed against the current VU syllabus to help students prepare for 2026 Midterm, Final-Term, and online quiz examinations.

Inside this file

Digital Logic & Design

  Dr. Waseem Ikram

      Lecture 02

                   Recap

Last lecture discussion
 Decimal Number Systems

 Caveman Base 5 Number System

 Binary Number System

 Number System Conversion

Today’s lecture discussion
 Decimal-Binary Conversion

       Binary to Decimal Conversion

 Sum-of-Weights
   Expression base number & weights

   Sum terms

   Paper and pencil method

 Sum of non-zero terms

   Mental Arithmetic, quick method

   Sum of weights of non-zero terms

         Binary to Decimal Conversion

 Sum-of-Weights
 10011
        2
 (1 x 24) + (0 x 23) + (0 x 22) + (1 x 21)
  + (1 x 20)
 Terms 16, 0, 0, 2 and 1

 19

          Binary to Decimal Conversion

 Add weights of non-zero terms
 Weights increase/decrease by power of 2

 10011 = 16 + 2 + 1 = 19
       2

   1011.1012 = 8 + 2 + 1 + 1/2 + 1/8
                  = 11 + 5/8
                  = 11.625

        Decimal to Binary Conversion

 Sum-of-Weights method used in reverse
   Highest binary weight less than the decimal

    number
   Subsequent smaller weights that add up to

    decimal number
 Repeated division by 2

   Paper and pencil method

   Number repeatedly divided by 2

Decimal to Binary Conversion using Sum-of-
                  Weights
 number Weight Result after subtraction Binary Bit
 392     256      392-256 = 136          1    b8
 136     128      136-128 = 8            1    b7
 8       64                              0    b6
 8       32                              0    b5
 8       16                              0    b4
 8       8        8-8 =0                 1    b3
 0       4                               0    b2
 0       2                               0    b1
 0       1                               0    b0

      Decimal to Binary Conversion
number   Quotient after division   Remainder after division
392      196                       0             (b0)
196      98                        0             (b1)
98       49                        0             (b2)
49       24                        1             (b3)
24       12                        0             (b4)
12       6                         0             (b5)
6        3                         0             (b6)
3        1                         1             (b7)
1        0                         1             (b8)

        Binary-Decimal fraction conversion

   Binary to Decimal Conversion
     Sum-of-Weights method

     Weights decrease by a factor of 2

     0.1101 weights ½, ¼, 1/16
             2

    Sum up to 0.8125
    

 Decimal to Binary Conversion

   Repeated Multiplication by 2

   example

       Decimal-Binary fraction conversion

   Decimal to Binary Conversion
     Repeated multiplication by 2

      Number     Mult. By 2          Integer

      0.8125     1.625               1         (b-1)
      0.625      1.250               1         (b-2)
      0.250      0.500               0         (b-3)
      0.500      1.000               1         (b-4)

                Binary Arithmetic

 Binary Addition
 Binary Subtraction

 Binary Multiplication

 Binary Division

                 Binary Addition
   Four Basic rules for binary addition

    1st digit   2nd digit   Sum            Carry
    0           0           0              0
    0           1           1              0
    1           0           1              0
    1           1           0              1
   Addition of multiple binary numbers

                 Binary Addition

Carry                1      10     1
1st Number           1      0      1   1
2nd Number                  1      1   0
3rd Number           1      0      0   0
4th Number                         1   1
Result       1       1      1      0   0

                 Binary Subtraction

   Four Basic rules for binary subtraction

    1st digit   2nd digit   Difference    Borrow
    0           0           0             0
    0           1           1             1
    1           0           1             0
    1           1           0             0

             Binary Subtraction

Borrow                   1
1st Number        1      0        1   1
2nd Number               1        1   0
Result                   1        0   1

                Binary Multiplication

   Four Basic rules for binary multiplication

         1st digit   2nd digit   Product
         0           0           0
         0           1           0
         1           0           0
         1           1           1
    Example of Binary Multiplication

            Binary Multiplication

                           1101     (13)
                     x      101     (5)
1st product term     1101
2nd product term    0000
3rd product term   1101
Product                1000001      (65)

            Multiplication by shifting left

 Decimal 29 shifted left by one digit
 290

 Shift left 1 digit is multiply by 10

   Binary 111012 (29) shifted left by one bit
   1110102 (58)
   Shift left 1 bit is multiply by 2

                Binary Division

        10
101 | 1101
        101
         011
       000
           11

               Division by shifting right

 Decimal 29 shifted right by one digit
 2.9

 Shift left 1 digit is divide by 10

   Binary 111012 (29) shifted left by one bit
   1110.12 (14.5)
   Shift left 1 bit is divide by 2

       Signed and Unsigned Numbers

 Unsigned Binary Numbers
 Signed Binary Numbers

   Most significant bit represents sign

   0 represents a positive number

   1 represents a negative number

            2’s Complement form

 1’s complement form
 2’s complement form

Binary number    01101    (13)
1’s complement   10010
                      +   1
2’s complement   10011     (-13)

       Addition and Subtraction with 2’s
                 Complement

0101         +5             0101      +5
0010         +2             1110      -2
0111         +7             0011      +3

More CS302 files

All CS302 files · Midterm Prep 2026 · MCQs Bank