E2 Hardware Description Language
You have already learned the basics of digital circuits and designed simple processors in Logisim. However, you should also realise that Logisim is not suitable for designing more complex circuits. In fact, modern processors are designed using hardware description languages (HDLs). Next, you will learn how to design digital circuits using HDLs.
It should be noted that although we will no longer use Logisim for processor design later on, the experience gained from using Logisim should have helped you develop ‘circuit mindset’: digital circuit design only does two things, ‘instantiation’ and ‘wiring’. When you use HDL to design digital circuits in the future, you should also establish a connection between HDL code and your experience with Logisim in your mind: You are simply using a different method to design circuits, but fundamentally, you are still doing 'instantiation' and 'wiring'." Therefore, you should be able to visualise the logical structure of the circuit based on the code you write. If you find yourself unable to visualise it, you're very likely to design a low-quality circuit (low frequency, large area, high power consumption), or even circuits that do not function as expected.
Learn Verilog Language through Online Websites
We recommend the Verilog online learning website HDLBits, which provides a wealth of exercises and uses online simulation to determine whether your code is correct.
If you are confident in your Verilog skills, try completing the following exercises:
- Sequential Logic
- Finite State Machines
- Lemmings 1
- Lemmings 2
- Lemmings 3
- Lemmings 4
- PS/2 packet parser
- PS/2 packet parser and datapath
- Serial receiver
- Serial receiver and datapath
- Serial receiver with parity checking
- Finite State Machines
If you find the above exercises very difficult, we recommend that you start with the basic exercises. Specifically, you need to complete the exercises corresponding to the following chapters:
- Getting Started - recommended to complete, to familiarize yourself with the exercise workflow
- Verilog Language - recommended for those not yet familiar with Verilog
- Combinational Logic
- Basic Gates
- More logic gates
- Truth tables
- Simple circuit A
- Simple circuit B
- Thermostat
- 3-bit population count
- Even longer vectors
- Multiplexers
- 2-to-1 multiplexer
- 9-to-1 multiplexer
- 256-to-1 4-bits multiplexer
- Arithmetic Circuits
- Signed addition overflow
- 100-bits binary adder
- Basic Gates
- Sequential Logic
- Latches and Flip-Flops
- D flip-flip
- DFF with reset value
- DFF with asynchronous reset
- DFF with byte enable
- Mux and DFF
- Create circuit from truth table
- Detect an edge
- Detect both edges
- Edge capture register
- Dual-edge triggered flip-flop
- Counters
- Decade counter again
- Slow decade counter
- Counter 1000
- 12-hour clock
- Shift Registers
- Left/right rotator
- Left/right arithmetic shift by 1 or 8
- 5-bits LFSR
- Shift register
- 3-input LUT
- More Circuits - complete all
- Finite State Machines - complete all
- Latches and Flip-Flops
Additional Recommended Learning Resources for Digital Circuits
- Digital Design and Computer Architecture: If you need to learn some theoretical knowledge of digital circuits during your studies, you can refer to chapters 1 to 5 in this book.
- Introductory Verilog Video
- Verilog Syntax Overview
- Advanced Digital System Design Techniques and Case Studies in Verilog
- USTC Verilog OJ Platform(registration and login required)
Learning the Agile Development Language Chisel
For some complex digital circuits, using Chisel can make the design process more convenient. You will gradually realize this during your study in Stage B. However, One Student One Chip does not restrict which language you use to design your processor.
If you plan to learn Chisel, we still recommend that you first master the basics of Verilog, then, follow this suggested learning sequence:
- Chisel Bootcamp It is a very good chisel tutorial, also supports running chisel code online, you can write chisel code while learning. Among them are
- Chapter 1 is an introduction to scala.
- Chapter 2 is chisel basics.
- Chapter 3 is a mix of advanced scala features and chisel.
- Chapter 4 is about the FIRRTL backend You will need to complete the first two chapters, and we strongly recommend that you take Chapter 3. Chapter 4 is not directly related to this course and can be used as extra reading material.
- Chisel Users Guide It's a good introduction to chisel, as it organizes the features of chisel in a more systematic way.
- Chisel cheatsheet A concise list of common uses cases of the chisel language.
- Digital Design with Chisel is a reference book that integrates digital logic design concepts with Chisel.
- Chisel API All APIs of the chisel library are listed in detail for reference.
If you would like to join the Chisel discussion group, you can scan the QR code below using WeChat and contact a teaching assistant to request access:
