























The world is digital, but life is analog..


























always @(posedge clk)) that updates the current state to the next state at every clock edge, or resets it when a reset signal is triggered.








The book is finally in =).
There is a specific kind of satisfaction in hardware engineering—the moment a conceptual logic circuit transitions from a schematic to a functional physical implementation. My fascination with this process began in 1999 during my undergraduate studies under Professor Othman Sidek. Back then, the ability of an FPGA to house a vast array of logic functions felt revolutionary.
It all started with a project in my Digital Electronics 2 subject. I remember it vividly, we built an automated counter for badminton matches. The digital logic system was designed to detect whether a shuttlecock landed in or out of bounds to assist the umpire in ruling points. That small-scale project served as the gateway to a much deeper exploration into digital systems.
From Undergraduate Roots to GSM Architecture
By the time I reached my final year project, I was diving deep into digital systems for GSM communication modules. Through a family connection—my cousin, who was then a technician for a leading telecommunications provider—I gained invaluable access to the industry standards of the time.
I was particularly focused on implementing Convolutional Encoders, which were essential for error correction in mobile networks. At the time, we worked across the five primary channel types:
TCH/FS (Full Rate Speech)
TCH/HS (Half Rate Speech)
FACCH (Fast Associated Control Channel)
SACCH (Slow Associated Control Channel)
SDCCH (Standalone Dedicated Control Channel)
The successful implementation of these designs wasn’t just a hurdle to pass for graduation, it was the foundation of my continued passion with digital logic =p
Fast forward to 2021, I returned to the classroom to teach Digital System Design. Re-engaging with the subject after years in the field felt like a homecoming. During this period, I began supervising Phuah Soon Eu on the project involving the implementation of metaheuristic algorithms on IC chips.
The inherent challenges of translating high-level algorithms into hardware were tackled: managing floating-point arithmetic, optimizing RAM architectures, and modifying algorithmic flows to suit the rigid requirements of digital implementation.
Introducing the Book: A Practical Path for the Novice
Through the project implementation, a persistent “missing link” in technical FPGA education literature. There is a steep cliff between learning basic Verilog and understanding the professional constraints of a production-ready FPGA design.
To bridge this gap, this book is introduced.
Digital System Design with Verilog: FSM, RTL Modelling, Pipelining and Static Timing Analysis
The philosophy is simple: The best way to learn a system is to build it. We designed this text to guide the reader through three critical phases:
Foundations: Introduction to FPGA architecture and Hardware Description Language (HDL).
Synthesis: A deep dive into RTL modeling and the complexities of Static Timing Analysis (STA).
Implementation: Mastering FPGA-specific design and the art of optimization.
Moving from Functional to Professional
This book is specifically written for those at the “Novice to Early-Intermediate” stage. It is for the designer to learn to perform a functional simulation but needs to learn how to read synthesis reports, meet specific timing targets, and redesign circuits with objective-driven outcomes.
It has been a privilege to author this with Phuah Soon Eu, and we hope this work serves as a catalyst for the next generation of digital designers—much like a badminton counter did for me decades ago :).
*UMPSA STEM Lab Raspberry Pi Programming Synopsis can be found here.
In the Raspberry Pi IoT session, 20 students and teachers from Kolej Vokasional Kulim were introduced to the concept of the Internet of Things (IoT) using Raspberry Pi on the UMP STEM Cube, a pico-satellite learning kit specifically designed to facilitate engineering learning.
The content covered basic digital input/output operations on onboard LEDs, as well as topics such as dashboard design using gyro meter and BMU280 sensor data, including collecting and storing data in a cloud database. Participants learned to interface sensors with Raspberry Pi boards and develop IoT applications for real-world scenarios. The session provided students with valuable insights into IoT technology and its applications in various domains.
A special appreciation is extended to Cikgu Shufi from KV Tawau, Sabah for coordination in facilitating communication between the participants and the UMPSA STEM Lab :).
Nurul April 26th

















*UMPSA STEM Lab Raspberry Pi Programming Synopsis can be found here.
In the Raspberry Pi IoT session, 28 students and teachers from Kolej Vokasional Kulim were introduced to the concept of the Internet of Things (IoT) using Raspberry Pi on the UMP STEM Cube, a pico-satellite learning kit specifically designed to facilitate engineering learning.
The content covered basic digital input/output operations on onboard LEDs, as well as topics such as dashboard design using gyro meter and BMU280 sensor data, including collecting and storing data in a cloud database. Participants learned to interface sensors with Raspberry Pi boards and develop IoT applications for real-world scenarios. The session provided students with valuable insights into IoT technology and its applications in various domains.
A special appreciation is extended to Cikgu Aminah dan Cikgu Huraiah from KV Kulim for coordination in facilitating communication between the participants and the UMPSA STEM Lab :).
Nurul April 26th

*UMPSA STEM Lab Raspberry Pi Programming Synopsis can be found here.
In the Raspberry Pi IoT session, 24 UMPSA mentors were introduced to the concept of the Internet of Things (IoT) using Raspberry Pi on the UMP STEM Cube, a pico-satellite learning kit specifically designed to facilitate engineering learning.
The content covered basic digital input/output operations on onboard LEDs, as well as topics such as dashboard design using gyro meter and BMU280 sensor data, including collecting and storing data in a cloud database. Participants learned to interface sensors with Raspberry Pi boards and develop IoT applications for real-world scenarios. The session provided students with valuable insights into IoT technology and its applications in various domains.
A special appreciation is extended to En Mohd Jamil Jaafar for coordination in facilitating communication between the participants and the UMPSA STEM Lab :).

















As part of ongoing efforts to strengthen digital pedagogy and future-ready STEM education, a Train-the-Trainer (TTT) Teachers Training Programme was successfully conducted for teachers from across Pahang, focusing on Arduino programming using ESP platforms and Edge Impulse for image classification.
The programme was designed to equip teachers with hands-on experience in digital making while introducing fundamental concepts of machine learning, particularly in the context of computer vision and image classification.
The main objectives of this TTT programme were to:
During the training, teachers were introduced to Arduino programming on ESP platforms (such as ESP32), covering:
This hands-on approach allowed participants to move beyond theory and experience how hardware, software and AI intersect in real-world applications.
A key highlight of the programme was the introduction to Edge Impulse, a powerful yet beginner-friendly platform for embedded machine learning.
Teachers learned:
Through guided activities, participants successfully implemented basic image classification tasks, gaining confidence in applying AI concepts without requiring advanced programming or mathematical backgrounds.
Beyond technical skills, the programme emphasised pedagogical readiness. Discussions and activities focused on:
Teachers shared ideas on how these technologies could be adapted for subjects such as Asas Sains Komputer, Reka Bentuk Teknologi, STEM projects and robotics clubs.
This TTT programme marked an important step in empowering educators in Pahang with practical skills in embedded systems, AI and digital innovation. By strengthening teachers’ confidence and competency, the programme supports the broader goal of cultivating AI-literate students who are prepared for future technological challenges.
Moving forward, participants are expected to:
The Arduino–ESP–Edge Impulse TTT programme demonstrates that machine learning and AI are no longer confined to advanced laboratories. With the right tools and training, educators can bring AI-powered digital making into everyday classrooms—sparking curiosity, innovation and future-ready skills among students.
This initiative reinforces the commitment to strengthening STEM and AI education at the grassroots level, ensuring teachers remain at the heart of Malaysia’s digital and educational transformation.










This week, we continued our exploration of combinatorial circuits, focusing on Lab 3 (Session 5): Implementation and Comparison of Ripple Carry Adder (RCA) and Carry Look-Ahead Adder (CLA). This lab builds on students’ foundational understanding of digital logic and provides hands-on experience with adder architectures that are central to arithmetic logic units (ALUs).
The key objectives of this lab were to:
case statements and transitioning toward decoder-based designsStudents designed both adders using structural and behavioral modeling approaches in HDL:
Both designs were synthesized and deployed on the FPGA to observe real hardware performance, not just simulation results.


During functional testing, several input combinations were validated to ensure correctness:

These cases helped reinforce how carry propagation affects outputs and highlighted the functional equivalence of RCA and CLA despite architectural differences.

An important part of this lab was analyzing the post-implementation reports in Quartus.



Students were tasked with extracting and comparing the following parameters for both adder implementations:
As expected, the RCA generally exhibited a longer critical path delay due to serial carry propagation, while the CLA achieved a higher maximum clock frequency, demonstrating its advantage in speed-critical designs.

In digital circuits, Fmax (maximum clock frequency) tells us how fast a circuit can run when a clock is used. It depends on the critical path, which is the longest delay through the combinational logic. Signals must be able to travel along this path and settle before the next clock edge arrives. If the critical path is long, the circuit needs a slower clock. In this lab, the RCA has a longer critical path because the carry must pass through each bit one by one, while the CLA reduces delay by calculating carries in parallel.

When checking the Quartus Timing Analysis Report, students noticed that it shows “No Fmax” and “No clock properties to report.” This is normal for this lab. Both the RCA and CLA designs are purely combinational and do not include any clocked elements such as flip-flops or registers. Since there is no clock defined in the design, Quartus cannot calculate Fmax. Fmax is only reported for sequential circuits where data moves from one register to another using a clock. For this reason, Quartus only reports logic usage and combinational delay. Once registers are added in future labs—such as in a registered ALU or datapath—Fmax and full timing information will become available.

To clearly observe the difference in hardware utilization, the total number of logic gates and Configurable Logic Elements (CLEs) used in the system can be analyzed by implementing both a 32-bit Carry Look-Ahead Adder (CLA) and a 32-bit Ripple Carry Adder (RCA). By experimenting with these two adders under identical design conditions, a direct comparison can be made. This allows the differences in resource usage to be clearly identified, where the CLA generally requires more gates and CLEs due to its complex carry logic, while the RCA uses fewer resources but operates with a longer propagation delay.

The example design above employs a genvar as a compile-time counter within a Verilog generate loop to create the 32 stages of the ripple carry adder. The counter variable i controls the instantiation of each full adder, where A[i] and B[i] represent the operand bits at position i, and carry[i] and carry[i+1] form the carry chain between adjacent stages. This approach improves scalability and code modularity, allowing the adder width to be easily adjusted without altering the underlying architecture. Importantly, the use of a counter does not affect the synthesized hardware, as the loop is unrolled during synthesis.
In the latter part of the lab, we began transitioning from simple adders to basic ALU design concepts:
case statement was used to implement a multiplexer that selects the desired operation based on an opcode.We also discussed the next step in this progression: moving from case-based multiplexing toward decoder-based control logic, which scales better for more complex ALU designs.

You can also take this up a level by having your ALU with output assigned to 7 segment display:-





By the end of this lab, you should be able to:
This lab serves as a crucial bridge between basic combinational logic and more advanced processor datapath components, setting the stage for upcoming topics in sequential logic and CPU design.





















This week is important as we move from theoretical concepts to hands-on hardware implementation. You will be tackling Pre-Labs (Sessions 1 & 2) and Labs 1 & 2 (Sessions 3 & 4).
To succeed in this course and meet our core learning outcomes—specifically CO3, which focuses on developing FPGA designs using industry best practices—you must follow a structured approach.
Before touching the hardware, you must set up your digital environment. These sessions focus on Project Setup and Functional Verification.
Software Installation: Ensure you have Intel Quartus Prime Lite Edition (Version 18.1) and ModelSim installed on your computer.

Project Creation: Launch the New Project Wizard in Quartus. Critical step: You must target the specific FPGA device on our board: MAX 10 – 10M50DAF484C7G.



Functional Simulation: Use ModelSim to verify your logic before synthesis. This allows you to catch bugs in a software environment where signals are easy to trace.


Now, it’s time to bring your code to life on the DE10-Lite FPGA Board.

In this lab, you will learn to control the board’s ten user-defined LEDs.
The Logic: You will write a Verilog module utilizing a counter to create a delay.
Key Tip: Remember that the onboard clock runs at 50 MHz. Your counter must be large enough (at least 25 bits) to create a blink visible to the human eye.



Mechanical switches are “noisy.” When you flip a switch, the signal “bounces” rapidly between high and low before settling.
The Challenge: You will implement Debounce Logic using a counter to ensure the FPGA only registers a clean, stable signal.
The Goal: Observe the difference between a direct switch-to-LED connection and one filtered through your debounce logic.
Your lab worksheet is your evidence of learning. To receive full marks and satisfy CO3 requirements, every session entry must include:
Unique Module Naming: To ensure individual work, you must prefix your top-level modules with your unique initials (e.g., AZ_LED_Blinking). Generic names will result in mark deductions.
Verilog Code Snippets: Paste snapshots of your design module and your testbench.
Simulation Waveforms: Provide ModelSim screenshots. Don’t just paste the image; add notes explaining the logic proof and calculating the clock cycles or frequency observed.
Implementation Reports: After compiling in Quartus, open the Compilation Report. You must include snapshots showing Resource Utilization (how many LUTs and Registers your design used).
Once you have completed all activities and filled out your worksheet for Sessions 1 through 4:
Verify that all dates are recorded correctly.
Ensure every module name is unique to you / your team member.
Upload the completed document to KALAM (after Lab 6 – Session 8).
Success in digital design comes from attention to detail. Double-check your pin assignments in the Pin Planner before programming, and always verify your timing slack in the Summary Report.
For those who are interested to explore more about Pin Planner, do explore this YouTube :-
Happy designing, engineers!
This year marks a meaningful milestone for the UMPSA STEM Lab — ten years of exploring how we can make STEM learning more engaging, accessible, and relevant. What started as a small initiative has gradually grown into a vibrant community of student mentors, university advisors, collaborators, teachers, and learners who share a common goal: nurturing curiosity and building meaningful digital making skills.
Thank you to all the student mentors, university advisors, and collaborators who have contributed to this journey. The STEM Lab is a collective effort of dedication, creativity, and willingness to experiment, refining teaching modules, and continuously improving the way STEM activities are delivered.
Over the past decade, the STEM Lab has served not only as an outreach platform but also as a space for pedagogical exploration. One of the central questions guiding our work has always been: What is the best way to introduce digital making and engineering thinking to learners? Through workshops, classroom activities, and collaborative programs, we have explored various approaches to make STEM learning more experiential and meaningful.
The programs focuses on developing effective teaching approaches for digital making skill sets and engineering concepts for school children and university students. Engineering concepts such as microcontrollers, IoT systems, FPGA-based digital design, and AI can often feel abstract when taught purely through lectures. The STEM Lab therefore serves as a platform to explore how these concepts can be delivered through hands-on, project-based learning, allowing students to connect theoretical knowledge with practical system development. In this sense, the lab functions as a living environment for engineering education, where ideas about teaching and learning can be tested and refined.
A major component of our work revolves around physical computing. Learning becomes far more engaging when students can interact with the physical world. Over the years, our modules have incorporated a wide range of microcontrollers (Arduino, ESPs), Raspberry Pi single-board computers, and embedded platforms, allowing learners to build systems that sense, respond, and interact with their environment. Through projects involving sensors, actuators, and robotics, students experience firsthand how software and hardware come together to create interactive systems.
Alongside hardware development, programming has always been a central pillar of the lab’s activities. To support learners with different levels of experience, we adopt a gradual progression from block-based programming to line-based programming. Beginners can quickly explore ideas through visual programming environments, while more advanced learners transition toward structured coding, developing deeper understanding of programming logic and computational thinking.
In recent years, the lab has also expanded into AI and embedded intelligence. Using platforms such as Edge Impulse, learners can experiment with edge AI applications such as image classification, demonstrating how machine learning models can run directly on embedded devices. These activities introduce students to the growing field of intelligent systems, where sensing, data processing, and decision-making can occur at the edge.
More recently, the STEM Lab has begun integrating FPGA-based modules into its learning ecosystem. By exposing learners to hardware-level digital design and parallel processing concepts, these modules provide a deeper understanding of how modern embedded systems are built. Together, these platforms form a learning progression, from physical computing to embedded systems, edge AI, and advanced digital architectures.
Looking back over the past ten years, the most meaningful outcome is not simply the number of workshops conducted or technologies introduced. Rather, it is the community that has grown around the STEM Lab. Many of our former mentors have continued their journeys in engineering, research, and education, carrying forward the spirit of exploration that began in the lab.
As we move into the next decade, we hope to continue expanding this ecosystem, strengthening collaborations with educators, researchers, and industry partners while refining how digital making and embedded systems are taught. The future of technology will require not only technical expertise but also creativity, curiosity, and collaboration. These are the values that the STEM Lab strives to cultivate.
To everyone who has been part of this journey — mentors, advisors, collaborators, teachers, and learners — thank you for contributing your time, ideas, and passion. The past ten years have been an incredible learning experience, and the next chapter promises to be just as exciting.