当前位置:网站首页>Using the case statement will produce a latch condition
Using the case statement will produce a latch condition
2022-07-19 13:03:00 【data line】
Abstract
- In the use of case Statement and multiple outputs , Every case Branch statements should give the assignment of all outputs , Otherwise, the circuit will synthesize the latch .
- In the following example , Through the variable sel To select four outputs up、down、left、right Which is assigned 1, Two code implementation methods are given .
- In the first implementation , Every case The branch statement of gives all the output values .
- In the second way , Although the initial value of the variable is specified , But every case Statement does not assign values to all variables .
Code
`timescale 1ns / 1ps
module top(
input [1:0] sel,
input [1:0] sel1,
output reg up,
output reg down,
output reg left,
output reg right,
output reg up1=0,
output reg down1=0,
output reg left1=0,
output reg right1=0
);
[email protected](*)begin
up=0;down=0;right=0;left=0;
case(sel)
2'b00:up=1'b1;
2'b01:down=1'b1;
2'b10:right=1'b1;
2'b11:left=1'b1;
default:up=1'b1;
endcase
end
[email protected](*)begin
case(sel1)
2'b00:up1=1'b1;
2'b01:down1=1'b1;
2'b10:right1=1'b1;
2'b11:left1=1'b1;
default:up1=1'b1;
endcase
end
endmodule
Integrated circuit


It can be seen from the integrated schematic diagram , The second code implementation method produces LDCE( Asynchronously cleared latch)
边栏推荐
- 【Pygame 学习笔记】7.事件
- 10 minutes to customize the pedestrian analysis system, detection and tracking, behavior recognition, human attributes all in one!
- Which domestic API tool is better? It turned out to be it
- 通货收缩的市场何时反转?我们该如何操作?2020-03-13
- 力扣64-最小路径和——动态规划入门题型
- AE how to make Nebula particle special effects
- In depth sorting: summary of machine learning modeling and parameter adjustment methods
- XML文件解析
- The difference and use between get request and post request
- 音频控制常见BUG注意事项
猜你喜欢

AI is the designer who knows you best? Let users generate digital clothing "by heart" Adidas ozworld
[email protected] )|Rhodamine 6G modified MOF material | catalase @zif composite | MOF"/>Lanthanide metal organic skeleton( [email protected] )|Rhodamine 6G modified MOF material | catalase @zif composite | MOF

减半行情会不会来?有何投资机会?2020-03-11

Cloud health management system based on STM32 (using Alibaba cloud Internet of things platform)

Metal organic framework / nitrogen carbide nano sheet (uio-66/hocn) composite | mil-101 loaded Au Pd alloy nanoparticles | chemical reagent MOF customization

力扣198-213 打家劫舍Ⅰ、Ⅱ——动态规划
[email protected] Cobalt iron bimetallic organic skeleton cox/mil-100 (FE) | [email protected]
[email protected] Nanocomposites | zif-8/ poly"/>MOF customized materials | bimetallic CuNi MOF nano materials | core-shell structure [email protected] Nanocomposites | zif-8/ poly

C语言进阶——自定义类型:结构体 枚举 联合
Do you still need to release the database connection manually with typeorm
随机推荐
运维小白成长记—架构第6周
Harmonyos quick start: Hello World
Lazy to the bone, I am too lazy to write articles in CSDN. I write articles based on selenium simulation
Stable super odds, 9 years old mixin | 2022 Jincang innovative product launch was successfully held
Acwing785. Quick sort
XML文件解析
Figure execution engine (II)
C语言进阶——自定义类型:结构体 枚举 联合
力扣70-爬楼梯——动态规划
水调歌头·明月几时有
Growth of operation and maintenance Xiaobai - week 6 of Architecture
Mysql database tables add fields, delete fields, modify the arrangement of fields and other operations, but not soon
Uio-66 | fe3o4/cu3 (BTC) 2 metal organic framework (MOF) nanocomposites supported on silver nanoparticles | nagdf4:yb, er upconversion nanoparticles @zif-8
松下A6伺服驱动器外部绝对值光栅尺全闭环参数设置
Differences between get requests and post requests and usage examples
OSSImport迁移之路
光大期货网上开户安全吗?有没有开户指引?
Summary of ultrasonic sensor series articles
Do you still need to release the database connection manually with typeorm
Mycat2 builds MySQL master-slave separation