Chisel3 - Tutorial - Parity
https://mp.weixin.qq.com/s/OtiQnE52PwdCpvmzJ6VFnA
import chisel3._
import chisel3.util.Enum class Parity extends Module {
val io = IO(new Bundle {
val in = Input(Bool())
val out = Output(Bool())
})
val s_even :: s_odd :: Nil = Enum(2)
val state = RegInit(s_even)
when (io.in) {
when (state === s_even) { state := s_odd }
.otherwise { state := s_even }
}
io.out := (state === s_odd)
} object ParityMain {
def main(args: Array[String]): Unit = {
chisel3.Driver.execute(Array("--target-dir", "generated/Parity"), () => new Parity)
}
}
Chisel3 - Tutorial - Parity的更多相关文章
- Chisel3 - Tutorial - VendingMachine
https://mp.weixin.qq.com/s/tDpUe9yhwC-2c1VqisFzMw 演示如何使用状态机. 参考链接: https://github.com/ucb-bar/ch ...
- Chisel3 - Tutorial - VendingMachineSwitch
https://mp.weixin.qq.com/s/5lcMkenM2zTy-pYOXfRjyA 演示如何使用switch/is来实现状态机. 参考链接: https://github.co ...
- Chisel3 - Tutorial - Tbl
https://mp.weixin.qq.com/s/e8vJ8claauBtiuedxYYaJw 实现可以动态索引的表. 参考链接: https://github.com/ucb-bar/c ...
- Chisel3 - Tutorial - Stack
https://mp.weixin.qq.com/s/-AVJD1IfvNIJhmZM40DemA 实现后入先出(last in, first out)的栈. 参考链接: https://gi ...
- Chisel3 - Tutorial - Functionality
https://mp.weixin.qq.com/s/3hDzpJiANdwp07hO03psyA 演示使用函数进行代码复用的方法. 参考链接: https://github.com/ucb- ...
- Chisel3 - Tutorial - ByteSelector
https://mp.weixin.qq.com/s/RQg2ca1rwfVHx_QG-IOV-w 字节选择器. 参考链接: https://github.com/ucb-bar/chisel ...
- Chisel3 - Tutorial - ShiftRegister
https://mp.weixin.qq.com/s/LKiXUgSnt3DzgFLa9zLCmQ 简单的寄存器在时钟的驱动下,逐个往下传值. 参考链接: https://github.com ...
- Chisel3 - Tutorial - Adder
https://mp.weixin.qq.com/s/SEcVjGRL1YloGlEPSoHr3A 位数为参数的加法器.通过FullAdder级联实现. 参考链接: https://githu ...
- Chisel3 - Tutorial - Adder4
https://mp.weixin.qq.com/s/X5EStKor2DU0-vS_wIO-fg 四位加法器.通过FullAdder级联实现. 参考链接: https://github.co ...
随机推荐
- Json格式数据的解析
JSON是一种轻量级的数据交换格式,我们在编程中遇到的JSON数据通常就是一串字符串,只不过按照特定的格式去书写,这样当你把JSON数据传输给别人的时候对方只要使用这种特定的规则去阅读解析你的数据即可 ...
- 【Kafka】配置文件说明
目录 server.properties producer.properties consumer.properties server.properties # broker的全局唯一编号,不能重复 ...
- spark on yarn安装
网上关于spark的安装说明很多了,这里就以spark pre-build with user provided hadoop 安装包为例讲解, 下载spark pre-build with us ...
- Mysql常用sql语句(13)- having 过滤分组结果集
测试必备的Mysql常用sql语句,每天敲一篇,每次敲三遍,每月一循环,全都可记住!! https://www.cnblogs.com/poloyy/category/1683347.html 前言 ...
- 如何让html引用公共布局(多个html文件公用一个header.html和footer.html)
如何实现多个.html静态页,引用同一个header.html和footer.html文件? 直接上代码: 公共头部文件:header.html //不用写标准的html文档格式 <div> ...
- springDataJPQL实现增删改查及分页,原生sql查询,根据方法命名规则实现查询以及Specification查询
一.使用方法 1.在dao中定义开一个方法,使用方法的参数设置jpql,并且使用方法的返回值接受查询结果,在方法上添加@query注解,在注解中写jpql语句进行增删改查,测试 2.使用原生的sql语 ...
- Vue中如何监听组件的原生事件
在首页开发中,右下角有一个返回顶部的小箭头,将它单独封装成一个BackTop组件,但是它何时出现需要依赖于首页的滑动,即另外一个Scroll组件.如果直接在BackTop组件里面监听,则需要通过thi ...
- 改进Page Object公共方法封装(base_page)
import os from time import sleep from selenium import webdriver from selenium.webdriver.common.by im ...
- webpack指南(五)TypeScript
将webpack与TS进行集成. 1. 安装TypeScript 编译器和 loader npm install --save-dev typescript ts-loader 2. 在package ...
- MyCat基本知识
一.Mycat基本元素 1.逻辑库,mycat中存在,对应用来说相当于mysql数据库,后端可能对应了多个物理数据库,逻辑库中不保存数据 2.逻辑表,逻辑库中的表,对应用来说相当于mysql的数据表, ...