Chisel3 - Tutorial - VendingMachine
https://mp.weixin.qq.com/s/tDpUe9yhwC-2c1VqisFzMw
import chisel3._ import chisel3.util._// Problem: // // Implement a vending machine using 'when' states. // 'nickel' is a 5 cent coin // 'dime' is 10 cent coin // 'sOk' is reached when there are coins totalling 20 cents or more in the machine. // The vending machine should return to the 'sIdle' state from the 'sOk' state. // class VendingMachine extends Module { val io = IO(new Bundle { val nickel = Input(Bool()) val dime = Input(Bool()) val valid = Output(Bool()) }) val sIdle :: s5 :: s10 :: s15 :: sOk :: Nil = Enum(5) val state = RegInit(sIdle) when (state === sIdle) { when (io.nickel) { state := s5 } when (io.dime) { state := s10 } } when (state === s5) { when (io.nickel) { state := s10 } when (io.dime) { state := s15 } } when (state === s10) { when (io.nickel) { state := s15 } when (io.dime) { state := sOk } } when (state === s15) { when (io.nickel) { state := sOk } when (io.dime) { state := sOk } } when (state === sOk) { state := sIdle } io.valid := (state === sOk) }object VendingMachineMain { def main(args: Array[String]): Unit = { chisel3.Driver.execute(Array("--target-dir", "generated/VendingMachine"), () => new VendingMachine) } }
转载于:https://www.cnblogs.com/wjcdx/p/10093530.html
Chisel3 - Tutorial - VendingMachine相关推荐
- Chisel3 - Tutorial - Parity
https://mp.weixin.qq.com/s/OtiQnE52PwdCpvmzJ6VFnA 奇偶发生器.统计输入中1的个数,如果为偶数则输出0,奇数则输出1. 参考链接: https: ...
- Python Tutorial(十):浏览标准库(一)
10.1 操作系统接口 os模块提供很多函数用于和操作系统的交互: 确定使用import os风格而不是from os import *.这将避免os.open()被内建的open()函数遮住,它的操 ...
- ue5新手零基础学习教程 Unreal Engine 5 Beginner Tutorial - UE5 Starter Course
ue5新手零基础学习教程 Unreal Engine 5 Beginner Tutorial - UE5 Starter Course! 教程大小解压后:4.96G 语言:英语+中英文字幕(机译)时长 ...
- Finding iPhone Memory Leaks: A “Leaks” Tool Tutorial[转]
Finding iPhone Memory Leaks: A "Leaks" Tool Tutorial by OWEN GOSS on 12. FEB, 2009 in RESO ...
- 宏基因组教程Metagenomics Tutorial (HUMAnN2)
分析流程 下载测试数据 了解输入文件 软件安装和环境变量 序列质控和去宿主 质控后结果统计 合并双端 计算功能和代谢通路 多样品物种和功能组成合并为矩阵/表 STAMP软件统计绘图 整理humann2 ...
- 微生物相关网络构建教程中文Microbial association network construction tutorial
原文为自Microbial association network construction tutorial http://psbweb05.psb.ugent.be/conet/microbial ...
- 【ACL2020】这8份Tutorial不可错过!包括:常识推理、多模态信息抽取、对话、解释性等...
点击上方,选择星标或置顶,不定期资源大放送! 阅读大概需要7分钟 Follow小博主,每天更新前沿干货 自然语言处理领域顶级会议 ACL 2020 将于 7 月 5 日至 10 日在线上举行.本届 A ...
- 【CVPR2020来啦】不容错过的29个教程Tutorial !(附Slides下载链接)
点击上方,选择星标或置顶,不定期资源大放送! 阅读大概需要6分钟 pick小博主,每天更新前沿干货 [导读]IEEE国际计算机视觉与模式识别会议 CVPR 2020 (IEEE Conference ...
- Beginning Adaptive Layout Tutorial
为什么80%的码农都做不了架构师?>>> Update 19th November 2014: Updated for Xcode 6.1. Learn how to make ...
最新文章
- Windows XP下如何设置电脑定时关机
- 解析#pragma指令
- 复制网页自动追加文字js
- python tableview绑定字典_TableView索引的添加
- 单片机c语言慧尾灯编码,(参考)基于单片机的智能尾灯开发文档.doc
- 从Wasserstein距离、对偶理论到WGAN
- python绘制折线图怎么样填充空白颜色_Python:填补两幅图之间的空白
- ajax设置自定义请求头信息
- kickstart 为 rhel5 创建 ext4 分区
- 在51系列中data,idata,xdata,pdata的区别
- python中文字符串排序问题_Python字符串排序
- HI3518E 中Sample Venc分析
- Qt_屏幕保护程序、进程监听、数据库读取、屏幕保护
- xrd连续扫描和步进扫描_XRD简答
- directive 自定义指令
- 英语和编程到底是什么关系?
- English trip 自习内容 英语时态
- 【T+】删除/取消畅捷通T+软件登录账套后的“查看认证”按钮
- 双云台AI智能分析跟踪会议云台摄像机技术应用
- cmd设置总是置顶_windows 下如何让一个窗口置顶?
热门文章
- 10.1 国庆 考试
- Oracle按照时间统计总结
- gradlew 的https代理设定
- 【转】微信扫描二维码登录网页是什么原理?
- java struts2相关记录
- 发布:IE自动打印插件
- [转]Java + TestNG + Appium 实现单机多个Android终端并发测试
- gunzip 和 unzip 解压文件到指定的目录
- MYSQL max_user_connections back_log max_connections参数和Max_used_connections
- [Python爬虫] 之五:Selenium 处理滚动条