From the course: Learning Verilog for FPGA Development
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Range specification - FPGA Tutorial
From the course: Learning Verilog for FPGA Development
Range specification
- [Instructor] Range specification is a very nice feature that allows you to create collections of elements, such as wire busses, register busses, and even arrays of gates. With range specification, you may also concatenate data and refer to data partially. Let me show you some practical examples. Registers and wires are often useful as multi-bit busses. Please be advised that the following coding examples are only for syntax purposes, although this module compiles correctly, it does not produce a meaningful simulation. In line 24, we have a wire bus named my_wire. The syntax is simple. First, specify the type, then the index range between square brackets with its bounds separated by a colon, and finally the name of the bus. The wires in this bus are numbered from seven to zero, including both, so it's a nate wire bus. Seven and zero here, means that the bus has a wire you can refer to as my_wire indexed at seven.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Verilog modules4m 13s
-
(Locked)
Instantiating modules4m 49s
-
(Locked)
Gates and primitives3m 3s
-
(Locked)
Registers and wires1m 46s
-
(Locked)
Range specification4m 30s
-
(Locked)
Numbers and constants4m 53s
-
(Locked)
Always blocks52s
-
(Locked)
The if-else statement2m 2s
-
(Locked)
Case statements2m 24s
-
(Locked)
Boolean algebra expressions56s
-
(Locked)
Continuous assignments2m 23s
-
(Locked)
Blocking assignments3m 20s
-
(Locked)
Nonblocking assignments3m 49s
-
(Locked)
Challenge: From schematic to code2m 16s
-
(Locked)
Solution: From schematic to code4m 31s
-
-
-
-
-