• Ingen resultater fundet

The Vending Machine

N/A
N/A
Info
Hent
Protected

Academic year: 2022

Del "The Vending Machine"

Copied!
21
0
0

Indlæser.... (se fuldtekst nu)

Hele teksten

(1)

The Vending Machine

Martin Schoeberl

Technical University of Denmark Embedded Systems Engineering

April 7, 2022

(2)

Overview

I Your final grade I Online exam I GoL in hardware

I The Vending Machine project I

I How did it go with the display multiplexer!

I Please show working versions to your TA

2 / 21

(3)

Your Final Grade

1. Your lab work, the vending machine I What is working (TA checks) I Your report

I Basic functions is a 7, extra functions needed for a 10 or 12 2. Written exam

I Two hour written exam

(4)

Exam Topics and Questions

I The pensum (reading lis) is on theweb site

I Compute maximum frequency and delays of a given circuit I Given a Chisel description of a circuit, draw it

I Given a circuit drawing, sketch the Chisel description I Basically what we have done in the lab

I No surprises (at least not too many ;-)

4 / 21

(5)

Game of Live

I Conway’s Game of Life

I Any live cell with two or three live neighbors survives.

I Any dead cell with three live neighbors becomes a live cell.

I All other live cells die in the next generation. Similarly, all other dead cells stay dead.

(6)

Game of Live

I You did an implementation in Java I The problem is highly parallel

I I will show you a Chisel (and Java) implementation I FPGA version is extremely fast compared to the Java

implementation

I https://github.com/schoeberl/game-of-live

6 / 21

(7)

Performance Comparison

Execution time (us) FPGA Speedup World Cells Mac Rasperry FPGA Mac Rasperry

10x10 100 0.10 1.783 0.0040 25 445

20x20 400 0.33 5.137 0.0040 82 1284

30x30 900 0.70 9.965 0.0041 170 2430

40x40 1600 1.21 17.212 0.0040 302 4302

50x50 2500 1.81 25.204 0.0044 411 5728

60x60 3600 2.76 37.822 0.0045 613 8404

70x70 4900 3.54 57.665 0.0040 884 14416

80x80 6400 4.81 64.396 0.0047 1023 13701 90x90 8100 6.50 81.309 0.0045 1444 18068 100x100 10000 7.51 109.964 0.0048 1564 22909

(8)

A Vending Machine from 1952

Source: Minnesota Historical Society,CC BY-SA 2.0

8 / 21

(9)

The Vending Machine

I Final project is a vending machine I Description is on GitHub: README.md I Will repeat the overview now

I Group work

I Final version shall be run in an FPGA

I A lot can be done with testing and simulation

(10)

The Vending Machine

I Inputs: coins, buy

I Display: price and current amount I Output: release can or error

I Small challenge to multiplex the display

I State machine with data path is thebrainof the VM I Guided step by step over several weeks

10 / 21

(11)

Vending Machine Specification I

I Sell 1 item and not returning any money I Set price with 5 switches (1–31 kr.)

I Display price on two 7-segment displays (hex.) I Accept 2 and 5 kr. (two push buttons)

I Display sum on two 7-segment displays (hex.) I Amount entered so far

I Does not return money, left for the next purchase

(12)

Vending Machine Specification II

I Push buttonBuy

I If not enough money, activatealarmas long as buy is pressed

I If enough money, activaterelease itemfor as long asbuyis pressed and reducesumby the price of the item

12 / 21

(13)

Optional Extras

I Needed for a 10 or 12 I Display decimal numbers

I Supplement alarm by some visuals (e.g., blinking display) I Count coins and display an alarm when compartment is full

(>20 coins)

I Have some text scrolling on the display

I Connect a UART to your VM and sending messages to your laptop

I ...

I Your ideas :-)

(14)

Design and Implementation

I Implementation shall be a state machine plus datapath I Design your datapath on a sheet of paper

I Datapath

I Does add and subtract

I Contains a register to hold the sum I Needs some mulitplexer to operate I Display needs multiplexing

I Implemented with some counters and a multiplexer I Show each part of your design to a TA

I 7-segment decoder, 7-segment with a counter, display multiplexer, complete vending machine

14 / 21

(15)

Draw Figures

I Drawings/schematics is another language to describe (digital) circuits

I Draw, draw, draw boxes and arrows!

I Use drawing during development

I If you cannot draw your circuit you do not understand it I Use drawings to communicate with the TA

I Have drawings in your report

I You willfor sureneed to draw circuits at the exam ;-)

(16)

Vending Machine Design and Implementation Steps

I We started in week 6 (now we are in week 10) I lab 6: Hexadecimal to 7-segment decoder I lab 8: 7-segment display with a counter I lab 9: Multiplexed Seven-Segment Display I lab 10–13: Complete Vending Machine I Show your working design to a TA

16 / 21

(17)

Final Report

I One report per group I A single PDF

I Your group number is part of the file name (e.g., group7.pdf) I Code as listing in an appendix (no .zip files)

I Hand in in DTU Inside I Content

I Abstract

I Preface (Who did what)

1. Introduction and Problem Formulation 2. Analysis and Design

3. Implementation 4. Testing

5. Results 6. Discussion 7. Conclusion

(18)

Material on the Lab GitHub

I A top-level component

I XDC file for Basys pins and frequency I A start of a tester generating waveforms I A simulation of the board

I Show it (in IntelliJ)

18 / 21

(19)

An Optional Lab

I Testing the a Vending Machine

I Black box testing (you don’t see the implementation) I I give you two implementations

I One is OK, one is broken

I Which one is broken, and what it the error?

I Issue is that you need Verilator and a C compiler to run the tests

I Therefore, only if you really want to do it I Lab 10

(20)

Questions on Final Project?

20 / 21

(21)

Summary

I Now you have four weeks for the Vending Machine I Should be plenty of time

I Standard solution is good for a standard grade I Add features as you like

I Have a good time with your Vending Machine construction

Referencer

RELATEREDE DOKUMENTER

Start 90-erne – Kommercielle lab- og lægesystemer I KPLL fastlægges:.. Koder for

Med en kampagne hvor gamle, særlige træer mærkes med et lille emblem vil Danmarks Naturfred- ningsforening være med til at skabe opmærksomhed om, at mange flere store, gamle

1) One joint KADK workshop committee. 2) Joint administrative management, eg. the chairman of the joint workshop council may have expanded powers with staff and budget

• Overblik over udestående bestillinger der ikke er modtaget svar på / effektueret.. • At patienterne får besked på parakliniske

melsen giver mulighed for, at der sættes initiativer i gang, der kan forebygge borgerens langtidssygemelding eller i værste fald opsigelse fra arbejdspladsen. DS ønsker, at

1) Indsatsen skal være den mindst indgribende indsats, der i tilstrækkeligt om- fang tilgodeser personens begrænsninger i arbejdsevnen og vurderes at fremme den størst mulige

forbedrer pågældendes mulighed for at komme i arbejde og dermed opnå selv- forsørgelse. Stk.2 Samtidig med henvisningen til arbejde, afgivelsen af tilbud, indkaldelsen til samtale

For combining the between-lab and between-material heteroscedasticity together, new model LB3 is processed on the basis of model MB2: 8 distinct residuals and 8 distinct lab