Diferență între revizuiri ale paginii „Applications 4”

De la WikiLabs
Jump to navigationJump to search
Linia 9: Linia 9:
 
[[Fișier: digits.png]]
 
[[Fișier: digits.png]]
  
The simplest implementation is a ROM
+
For all numbers greater than 9 the digit must be off.
 +
 
Test the transcoder by connecting its 4 bit input to SW[3], SW[2], SW[1] and SW[0], and displaying the output on a 7-segment display, the right digit (Digit0) of DE1-SOC display.
 
Test the transcoder by connecting its 4 bit input to SW[3], SW[2], SW[1] and SW[0], and displaying the output on a 7-segment display, the right digit (Digit0) of DE1-SOC display.
  
 
'''Coding style:'''
 
'''Coding style:'''
 
* '''case''' statements should always include the '''default''' case.
 
* '''case''' statements should always include the '''default''' case.
 
  
 
== Exercise 2 ==
 
== Exercise 2 ==

Versiunea de la data 13 martie 2019 11:56

Exercise 1

Make a 7-segment display transcoder using a case block that displays values ​​from 0 to 9. The input of the module will be called value and the output seg.

Segment.png

The output bits would control the segments of a digit display, one bit for each segment. The segment is lit when the corresponding bit is 0, otherwise it is off (negative logic).

Digits.png

For all numbers greater than 9 the digit must be off.

Test the transcoder by connecting its 4 bit input to SW[3], SW[2], SW[1] and SW[0], and displaying the output on a 7-segment display, the right digit (Digit0) of DE1-SOC display.

Coding style:

  • case statements should always include the default case.

Exercise 2

Implement a 3 bit adder whose result is displayed as a hexadecimal digit.

App4 adder.png

The result of the 3 bit addition is in the range [0, ... ,14] and it may be written in the hexadecimal base using only one digit. The transcoder must be extended to show hexadecimal digits greater than 9. Use the most common 7-segment symbols for them:

Letters.png

Exercise 3

Implement a 3 x 3 bits multiplier, with the result shown in decimal base as a 2 digits number.

App4 multiplier.png

This project comprises a top module with 4 blocks. The first block, multiplier, takes in two 3 bit numbers, a and b, and delivers the result of their multiplication in binary format. The input operands and the result are treated as unsigned integers (natural numbers). The next block, BCD converter, converts the result from the binary format to the decimal. The decimal digits are coded in binary, therefore a multidigit number is coded in the so called BCD format (Binary-coded decimal), where each decimal digit is represented as a 4 bit number.

App4 bcd.png