Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAV - Added solution links + small format changes #8

Merged
merged 8 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/DAV/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ import DocCardList from "@theme/DocCardList";
Welcome to DAV!
DAV aims to teach students the process of designing, building, and testing digital logic. Students can choose one of two tracks - the Digital Audio Visualizer track, with a capstone project involving displaying frequency levels on a VGA; and the Digital Design, Architecture, and Verification track, with a capstone project revolving around implementing a game that uses external peripherals. Along the way, students will learn about sequential logic, communication protocols, and graphics controllers. Additionally, DAV will introduce students to industry practices and prepare them for digital design and verification interviews.

Solutions to the labs can be found [here.](https://github.com/amidthestars/DAV-Outreach-Module-Solutions)

<DocCardList />
8 changes: 5 additions & 3 deletions docs/DAV/lab-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Welcome to DAV! By this point, you’ve probably attended or watched the first l

[Verilog Docs and FAQ](https://docs.google.com/document/d/1_8ruatZIb3sZb-3Kk3WOYC8Jzv4HvdwrTPZUGVupdVE/edit)

[Solution](https://github.com/amidthestars/DAV-Outreach-Module-Solutions)

## Contact Us

You can contact the DAV leads on Discord.
Expand Down Expand Up @@ -70,7 +72,7 @@ Remember that testbenches are less like digital circuit modules and more like si

Now that you’ve verified your design in simulation, it’s time to upload it to the FPGA and see if it really works. Set `miniALU_top.sv` as the top level and run Synthesis again.

Now, open the Pin Planner. It should list your top-level I/O ports at the bottom below a large grid of colors and shapes. Ignore the grid and refer to the [Pin Sheet]([Pin Sheet](https://docs.google.com/spreadsheets/d/1jTgphR61ozrNZlr9dLvId5t3o0FrikxSZWwAvhXF0Yo/edit#gid=0)) to map your pins. More detailed instructions are provided in the workshop.
Now, open the Pin Planner. It should list your top-level I/O ports at the bottom below a large grid of colors and shapes. Ignore the grid and refer to the [Pin Sheet](https://docs.google.com/spreadsheets/d/1jTgphR61ozrNZlr9dLvId5t3o0FrikxSZWwAvhXF0Yo/edit#gid=0) to map your pins. More detailed instructions are provided in the workshop.

Once you’ve done that, run the Fitter and Assembler, then program your FPGA. If all is well, each switch should be able to control the LED above it!

Expand All @@ -84,7 +86,7 @@ In this module, you’ll implement a very **basic ALU **that performs two operat

Your ALU will **use the switches** as indicated below:

![alt_text](images/image12.png "image_tooltip")
![An image of ten switches on an FPGA. The first four from the left are underlined in red as operand1, a 4 bit number. The next four are underlined as operand2, also 4 bits. The next switch (second from the right) is marked as the select switch.] (images/image12.png "image_tooltip")

The select switch will dictate whether the ALU operation is an **addition** (i.e. when `select` is HIGH, output **operand1 + operand2**) or a left-shift (when `select` is LOW, output **operand1 \<\< operand2**). There’s a commonly used hardware block (and a related Verilog construct) that allows you to select between two or more values based on a boolean condition; do you remember what it is? (Hint: It was mentioned in the lecture!)

Expand Down Expand Up @@ -114,7 +116,7 @@ In this part of the lab, you will implement a seven-segment decoder. In other wo

Each digit of the seven-segment display of the FPGA requires 8 bits to drive: 7 bits for the segments and an additional bit for the decimal point. This module, which we’ll call `sevenSegDigit`, accepts a **4-bit number** and a **1-bit on/off switch as input** and **output an 8-bit number** for the segments.

![alt_text](images/image11.png)
![A picture of a seven-segment display unit in the shape of an 8. 0 represents the top segment, 1 represents the top right segment, 2 represents the bottom right segment, 3 represents the bottom segment, 4 represents the bottom left segment, 5 represents the bottom right segment, and 6 represents the middle segment.](images/image11.png)

The segments in each digit are represented by the picture shown here. In other words, “bit 0” (i.e. the LSB) in your 8-bit number should represent the top segment, bit 1 should represent the top-right, etc. Pay careful attention to your indexing when you assign to these segments.

Expand Down
8 changes: 5 additions & 3 deletions docs/DAV/lab-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ In Lecture 2, you learned about all of the components behind sequential logic. Y

[Verilog Docs and FAQ](https://docs.google.com/document/d/1_8ruatZIb3sZb-3Kk3WOYC8Jzv4HvdwrTPZUGVupdVE/edit)

[Solution](https://github.com/amidthestars/DAV-Outreach-Module-Solutions)

## Contact Us

You can contact the DAV leads on Discord.
Expand Down Expand Up @@ -55,7 +57,7 @@ All that being said, here’s the “spec” for your clock divider:
- We tend to use this clock divider module for slower clocks where accuracy isn’t a high concern, so your speed input should only have enough bits to indicate a clock speed of at most **1 MHz**. You should think about how much that is in Hz and calculate the number of bits appropriately. (There’s a neat trick to finding that number of bits – see if you can find it in [Verilog Docs and FAQ](https://docs.google.com/document/d_8ruatZIb3sZb-3Kk3WOYC8Jzv4HvdwrTPZUGVupdVE/edit)!)
- As we discussed in lecture, the clock divider uses a counter to determine when to flip the clock. The counter’s maximum value is simply your division ratio – if your base clock is 16 Hz and your output speed is 4 Hz, your counter should increment every clock cycle but never exceed **3** , i.e. **`(BASE_SPEED / speed) - 1`**.
- We subtract 1 here because the counter range starts at 0, meaning that a clock period spans 0 to 3 – a total of 4 clock cycles.
- This module will require both a sequential block and a combinational block.
- This module will require both a sequential block and a combinational block. Recall that when we write sequential circuits, we try to keep our logic contained in the combinational block as much as possible, and we reserve the sequential block for synchronously assigning values.
- In the **combinational block**, you will determine what the value of your output clock will be for the next clock cycle. If the reset button is pressed, set the output clock to 0. If the counter is less than halfway up to the maximum value, i.e. less than or equal to 1 in the example above, also set the output clock to 0. Otherwise, set it to 1. This will ensure a **50% duty cycle**; most of our peripherals (including the buzzer) are only happy at 50%, so in general you should pick that as your output clock’s duty cycle of choice.
- :::note
A common industry standard naming convention is `regName_d` to indicate the value of `regName` on the following clock cycle.
Expand Down Expand Up @@ -107,7 +109,7 @@ For those who have never touched a breadboard, here’s a quick introduction.

Here’s a picture of a breadboard. For our purposes, we can ignore the areas between the - and + on either side. (If you’re curious, those would be for if you wanted to attach batteries or power sources.)

![alt_text](images/image2.png)
![A diagram of a breadboard.](images/image2.png)

What we want to observe is the pins in the middle. We’ll refer to the A-J lines as “columns” and the 1-30 lines as “rows.” (A2 would be column A, row 2). Notice the yellow lines connecting everything row-wise? If we want to connect something in series, we would want to connect them using pins in the same row. That’s all we’ll need for the purposes of DAV. (For reference, connecting things across columns would be connecting them in parallel.)

Expand Down Expand Up @@ -153,7 +155,7 @@ So how do we get started?

We’re going to provide you with a block diagram for the alarm clock. A block diagram is essentially a bird’s-eye view of all the modules in the stopwatch and how they go together. This is a simplified version, i.e. not everything is connected up and **the buzzer is missing** – if it were complete, you wouldn’t have very much to figure out yourself :-)

![alt_text](images/image1.png)
![A semi-complete block diagram of an alarm clock, with each block representing a module. The first module, "clockDivider," is clocked by the 50 megahertz clock from the FPGA, takes in a speed switch as input, and outputs a new clock at the desired speed. This divided clock becomes the clock for the alarmController module, which also takes in the buttons as input. The output of this module goes into the alarmClock top module, which contains the seven segment display and seven segment digit modules. The alarmClock top module outputs six buses that go into the FPGA's seven segment displays.](images/image1.png)

- Each rectangle is a “block,” or a module with the given name. (You can choose your own names if you’d like.)
- The wires coming from within `FPGA` are pins on the FPGA that you will route into your top level module, `alarmClock_top`.
Expand Down
4 changes: 4 additions & 0 deletions docs/DAV/lab-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ Ah yes, the FFT. In lecture 3, we covered how the Fast Fourier Transform (FFT) w
## Resources and Reference Material

[Link to Lecture 3](https://drive.google.com/file/d/1ZpZNq0DCSLgWa0FdoBjDLQwYdLYMBiAf/view?usp=sharing)

[Pin Sheet](https://docs.google.com/spreadsheets/d/1jTgphR61ozrNZlr9dLvId5t3o0FrikxSZWwAvhXF0Yo/edit#gid=0)

[Verilog Docs](https://docs.google.com/document/d/1_8ruatZIb3sZb-3Kk3WOYC8Jzv4HvdwrTPZUGVupdVE/edit)

[Solution](https://github.com/amidthestars/DAV-Outreach-Module-Solutions)

## Contact Us

You can contact the DAV leads on Discord.
Expand Down
2 changes: 2 additions & 0 deletions docs/DAV/lab-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Link to Lecture 5

[Verilog Docs and FAQs](https://docs.google.com/document/d/1_8ruatZIb3sZb-3Kk3WOYC8Jzv4HvdwrTPZUGVupdVE/edit)

[Solution](https://github.com/amidthestars/DAV-Outreach-Module-Solutions)

## Contact Us

You can contact the DAV leads on Discord.
Expand Down
2 changes: 2 additions & 0 deletions docs/DAV/lab-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ This lab, well, is not really a lab. It’s a guided walkthrough of how your mic

[Pin Sheet](https://docs.google.com/spreadsheets/d/1jTgphR61ozrNZlr9dLvId5t3o0FrikxSZWwAvhXF0Yo/edit#gid=0)

[Solution](https://github.com/amidthestars/DAV-Outreach-Module-Solutions)

## Contact Us

You can contact the DAV leads on Discord.
Expand Down
Loading