Free Examples
Sample code and tutorials from our books, free to download. Have an example you’d like to contribute? Email it to admin@lbebooks.com and we’ll review and post it.
C / Microcontrollers
Programming the DRAGON12-Plus or miniDRAGON-Plus2 using CodeWarrior
A/D Converter — Temperature Sensor
Reads the temperature from the sensor on channel 5, converts the reading into Celsius and Fahrenheit, and displays them on the LCD.
IR Sensor — Object Detection
Detects whether or not an object is present using the infrared (IR) sensor and displays the status on the LCD.
Servo Demo with POT
The potentiometer controls the position of the servo.
VHDL / FPGA
FPGA hardware design using the BASYS, Nexys-2, Nexys-3, Nexys-4, and Nexys-4 DDR boards
Solutions to Odd Problems in Chapter 2
Solutions to the odd problems in Chapter 2 of Learning By Example Using VHDL — Basic Digital Design with the BASYS FPGA Board. Most also apply to the Verilog — BASYS book.
Sprites in Block ROM
Displays the loon photograph on a VGA monitor and moves it around with the switches. Example 24 from Advanced Digital Design with the Nexys-2 or Nexys-3.
Traffic Lights
A state machine simulating a traffic light. Example 62 from Basic Digital Design with the BASYS FPGA Board.
PS/2 Keyboard
Accept data from a PS/2 keyboard through a standard PS/2 serial port. Example 41 from Advanced Digital Design with the Nexys-2 or Nexys-3.
Verilog / FPGA
FPGA hardware design using the BASYS, Nexys-2, Nexys-3, Nexys-4, and Nexys-4 DDR boards
Traffic Lights
A state machine simulating a traffic light. Example 62 from Basic Digital Design with the BASYS FPGA Board.
Sprites in Block ROM
Displays the loon photograph on a VGA monitor and moves it around with the switches. Example 24 from Advanced Digital Design with the Nexys-2 or Nexys-3.
Have an Example to Share?
We welcome contributions from professionals, students, and faculty. Email your example to admin@lbebooks.com and let us know if you'd like it posted anonymously or with your name and contact info. We'll review it promptly and post it!
Submit an Example