Intel® FPGA Academic Program Teaching Materials
Computer Organization
Summary
Get an introduction to computer organization using assembly language for Arm* or Nios® II processors, as well as programming in the C language for the same tasks. Topics covered include:
- Logic instructions and C code for embedded processors
- Subroutines and stacks
- Program-controlled polling and interrupt-driving input and output
- An introduction to graphics and animation
By the end of this course, students will have practical knowledge of:
- Writing assembly language and C language programs to perform many types of tasks
- Using the monitor program software for Intel® FPGAs to compile, download, and test programs
Professors: To request solutions, source material, software licenses, and teaching hardware, enroll in the Intel® FPGA Academic Program.
Instructor Notes:
- Prerequisite topics can be taught in the lecture sessions leading up to each lab exercise.
- A Terasic DE-Series SoC FPGA development kit with Arm Cortex*-A9 processor is required for use with the Arm version of these exercises.
- Any Terasic DE-Series FPGA development kit can be used with the Nios II processor version of these exercises.
Prerequisites
- Fundamentals of assembly language programming
- Fundamentals of computer architecture
- Fundamentals of the C programming language
Recommended Tools & Tutorials
- Intel FPGA Monitor Program
- System Design tutorials for Nios* II or ARM* processors
Note Platform Designer tutorials are optional and recommended only for creating custom IP or systems.
This .zip file contains all the Verilog and VHDL files for all the labs listed.
Lab 1: Use a Hard or Soft Processor System on Intel® FPGAs
Learn how programs written in an assembly language can be executed on an Intel® FPGA using the Altera Monitor Program software to compile, load, and run the application programs.
- Load a computer system onto an FPGA device.
- Set up a software development project.
- Use a simple application program to explore features of the Altera Monitor Program.
Lab 2: Logic Instructions
Explore various ways to use logic instructions.
- Practice manipulating bitstreams using load, move, compare, branch, shift, and mathematical logic instructions.
- Implement a search-and-count assembly language program and convert it to a subroutine.
- Present the results on the seven-segment displays of an FPGA development kit.
Lab 3: Subroutines and Stacks
This lab covers the concepts of parameter passing, stacks, and recursion.
- Write a loop to compute a summation, and then add recursion. Use the stack to save the state of the subroutine each time it recurses.
- Sort a list of 32-bit numbers into descending order.
- Write a program that computes the nth number in the Fibonacci sequence.
Lab 4: Input and Output in an Embedded System
Investigate the use of devices that provide input and output capabilities for a processor.
- Program a two-digit decimal counter on the seven-segment display.
- Implement polling to stop and start the counter when any push-button key is pressed.
- Add a hardware timer to the program.
Lab 5: Use Interrupts with Assembly Code
Further explore the use of interrupts in programs that interact with input and output devices.
- Write subroutines to set up timer and key interrupts.
- Modify the interrupt service routine to vary the speed of the timer.
- Implement a private timer as a third source of interrupts.
Lab 6: Use C Code with an FPGA Processor
Practice using C code on the FPGA hard or soft processor.
- Write C language programs that accomplish the same tasks as earlier labs.
- Compare the size of the machine code for assembly versus C language.
- Analyze the trade-offs in development ease versus system performance.
Lab 8: Introduction to Graphics and Animation
Explore how to display images and perform animation on a VGA terminal.
- Study the pixel buffer architecture of the VGA controller.
- Write a C program that implements the Bresenham line-drawing algorithm.
- Add physics to the program so that the animation moves and “bounces” off the edge of the display.
- Create a classic screen saver animation with multiple lines moving in random directions.
- Enhance the animation to vary the speed of movement, number of rectangles, and lines between the rectangles.