Lec_38.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_38.ppt for free?

You can preview and download "Lec_38.ppt" (CS302 PPT, ~450 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/lec-38-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 38

Recap

Equation definition for the Traffic Light
              Controller

     Equations

     TRSTATE.CLK = clk;
     TMRST := (TRSTATE = = NSY2) # (TRSTATE = = EWY2);

         The circuit diagram of the Traffic
                 Light Controller

FLASHCLK
MANUAL

NSSR                                                NSRED
EWSR                                                NSYEL
CLK                        GAL16V8        GAL16V8   NSGRN
                                     Q0
                   LTIME             Q1
                   STIME             Q2             EWRED
           Timer                                    EWYEL
                                                    EWGRN

                   TMRST

Pin declarations for the turning on/off
             traffic lamps

Pin Declarations

FLASHCLK, MANUAL       pin 1, 2;
!Q0, !Q1, !Q2         pin 4, 5, 6;
NSRED, NSYEL, NSGRN   pin 19, 18, 17;
EWRED, EWYEL, EWGRN    pin 14, 13, 12;

Switching of traffic lamps at different
                states

State   NSGRN   NSYEL   NSRED   EWGRN EWYEL   EWRED

NSG     on      off     off     off   off     on

NSY     off     on      off     off   off     on

NSY2    off     on      off     off   off     on

NSR     off     off     on      off   off     on
EWG     off     off     on      on    off     off

EWY     off     off     on      off   on      off
EWY2    off     off     on      off   on      off

EWR     off     off     on      off   off     on

   Equation definition for the turning
          on/off traffic lamps

Equations

NSRED = !MANUAL & (TRSTATE !=NSG) & (TRSTATE != NSY)
         & (TRSTATE != NSY2);
NSYEL = !MANUAL & ((TRSTATE = = NSY) # (TRSTATE = = NSY2))
         # MANUAL & FLASHCLK;
NSGRN = !MANUAL & (TRSTATE = = NSG);
EWRED = !MANUAL & (TRSTATE !=EWG) & (TRSTATE != EWY)
         & (TRSTATE != EWY2);
EWYEL = !MANUAL & ((TRSTATE = = EWY) # (TRSTATE = = EWY2))
         # MANUAL & FLASHCLK;
EWGRN = !MANUAL & (TRSTATE = = EWG);

        S-R flip-flop Transition table

Flip-flop Inputs        Output Transitions

S                  R    Qt                   Qt+1

0                  x    0                    0

1                  0    0                    1

0                  1    1                    0

x                  0    1                    1

Characteristic Equation for S-R Latch

      SR/Qt            0          1

       00              0          1

       01              0          0

       11              x          x

       10              1          1

              Q t +1 = S + RQ t

Characteristic equations of Latches
          and Flip-flops

  Device Type                  Characteristic Equation

  S-R Latch
                                 Q t +1 = S + RQ t
  D Latch
                                   Q t +1 = D
  Edge-triggered D flip-flop       Q t +1 = D
  J-K flip-flop                Q t +1 = JQ t + KQ t

Clocked Synchronous State Machine
       based on D flip-flops
                                            MAX

 ENABLE             D0                 Q0
                             SET
                         D         Q

                             CLR
                                   Q

                    D1                 Q1
                             SET
                         D         Q

                             CLR
                                   Q

  CLK

     Excitation Equations for D flip-flop
              inputs D0 and D1
D Flip-flop Inputs   Excitation Inputs

D0
                              D 0 = Q 0 EN + Q 0EN

D1
                           D1 = Q1 EN + Q 0 Q1EN + Q 0 Q1EN

Transition Equations for D flip-flops

         Transition Equations

                Q 0( t +1) = Q 0 EN + Q 0EN

            Q1( t +1) = Q1 EN + Q 0 Q1EN + Q 0 Q1EN

    Transition Table for D flip-flop based
               State Machine

Present State        Next State        Next State
                     ENABLE=0          ENABLE=1

Q1              Q0   Q1           Q0   Q1           Q0

0               0    0            0    0            1

0               1    0            1    1            0

1               0    1            0    1            1

1               1    1            1    0            0

        State table of a Mealy Machine

Present State   Next State   Next State   Output MAX   Output MAX
                ENABLE=0     ENABLE=1     ENABLE=0     ENABLE=1

A               A            B            0            0

B               B            C            0            0

C               C            D            0            0

D               D            A            0            1

State Diagram of a Mealy Machine

                    EN=1/
                    MAX=0
   EN=0/   A                   B    EN=0/
   MAX=0                            MAX=0

           EN=1/            EN=1/
           MAX=1            MAX=0

                                    EN=0/
                    EN=1/
           D        MAX=0      C    MAX=0

            EN=0/
            MAX=0

       State table of a Moore Machine

Present State   Next State   Next State   Output MAX
                ENABLE=0     ENABLE=1

A               A            B            0

B               B            C            0

C               C            D            0

D               D            A            1

State Diagram of a Moore Machine

                     EN=1
            A                 B
    EN=0   MAX=0            MAX=0   EN=0

            EN=1            EN=1

            D        EN=1    C      EN=0
           MAX=1            MAX=0

              EN=0

Clocked Synchronous State Machine
      based on J-K flip-flops

 X                J0                  Q0
                            SET
                        J         Q
 Y

                        K CLR Q
                   K0

                       J1             Q1
                                           Z
                            SET
                        J         Q

                        K CLR Q
                   K1

     CLK

Traffic Light
 Controller

More CS302 files

All CS302 files · Midterm Prep 2026 · MCQs Bank