- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
关闭。这个问题是opinion-based .它目前不接受答案。
想改善这个问题吗?更新问题,以便可以通过 editing this post 用事实和引文回答问题.
4年前关闭。
Improve this question
大多数(如果不是全部)VHDL 教科书随便列出了算术运算符,其中更随便地列出了左移算术 (SLA) 作为填充最右边元素的左移。虽然偶wikipedia不同意这个定义,我从来没有见过有人对这个定义眨眼,它只是表面值(value),“是的,有道理”。
然而,在二进制算术中填充最右边的值显然完全没有用,这让我感到疑惑 - 有没有人在现实生活中发现 SLA 的一个很好的用途 ?
(我不反对 SLA 的存在,也不想从 VHDL 中根除它。这只是复活节假期的一点乐趣......)
最佳答案
This网站提到:
At one point, there were actual shift operators built into VHDL. These were: srl, sll, sra, sla. However these shift operators never worked correctly and were removed from the language. This website goes into great detail about the history of these VHDL shift operators and discusses why they have been replaced by shift_right() and shift_left() functions.
The VHDL arithmetic left shift operator [sla] is unusual. Instead of filling the LSB of the result with zero, it copies the original LSB into the new LSB. While this is an exact mirror image of the arithmetic right shift, it is not the conventional definition of the operator, and is not equivalent to multiplication by a power of 2. In the VHDL 2008 standard this strange behavior was left unchanged (for backward compatibility) for argument types that do not have forced numeric interpretation (e.g., BIT_VECTOR) but 'SLA' for unsigned and signed argument types behaves in the expected way (i.e., rightmost positions are filled with zeros). VHDL's shift left logical (SLL) function does implement the aforementioned 'standard' arithmetic shift.
sla
的特殊情况。对于不同的数据类型表现不同。这对我来说听起来很愚蠢。
sla
等将被删除,这意味着必须重写许多旧代码。
sla
没有为
std_logic_vector
定义和
unsigned
类型等等......但它又回来了
ufixed
类型之类的。所以我设法编写了一些(vhdl-2008)代码来展示行为的差异:
entity test_e is
end entity;
library ieee;
architecture test_a of test_e is
constant value1 : bit_vector(3 downto 0) := "0001";
constant value2 : bit_vector(3 downto 0) := value1 sla 2;
use ieee.fixed_pkg.all;
constant value3 : ufixed(3 downto 0) := to_ufixed(1,3,0);
constant value4 : ufixed(3 downto 0) := value3 sla 2;
begin
end architecture;
关于vhdl - VHDL中SLA算子的真实使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43362834/
我关注了这个:How can I enable Flutter/Dart language experiments? 但是,传播运算符仍然对我不起作用。 最佳答案 您需要从终端运行 flutter u
在各种场合我都希望收到一个 Rx Replay 缓冲传入通知的运算符,在第一次订阅时同步重放其缓冲区,然后停止缓冲。此轻量级 Replay运营商应该只能为一个用户提供服务。可以找到此类运算符的一个用例
var items = []; var index = 0; var value = items[index]; // returns invalid value error, understood!
我想在文本中找到笔划的方向。 Sobel 算子如何用于此目的? 这张图显示的是dp,也就是梯度方向。我想知道如何应用 Sobel 运算符找到要选择的像素,从 p 到 q,沿着路径 sp,到找到边缘上的
我正在尝试在水平和垂直方向上实现 sobel 运算符。但不知何故我得到了反向输出。我在下面附上的代码。对于水平蒙版 char mask [3][3]= {{-1,-2,-1},{0,0,0},{1,
我在使用 Sobel 算子进行边缘检测时遇到问题:它会产生太多假边缘,效果如下图所示。我正在使用 3x3 sobel 运算符 - 首先提取垂直然后水平,最终输出是每个滤波器输出的幅度。合成图像的边
我很难理解 &^ and &^= operators 是什么在围棋中的意思。我无法在文档(说明操作符有点清晰,但对我帮助不大)或试验中找到答案。 特别是,我想知道 Python 中是否有等效项。 最佳
我目前正在从包含体素的 MRI 数据量中去除不均匀性。我想在这些体积上应用 sobel 算子来找到梯度。我熟悉 2d sobel mask 和 2d 图像的邻域。 索贝尔面具: 1 2 1 0 0 0
Img 是我输入的 RGB 图像 import cv2 import numpy as np img = cv2.imread("Lenna.png") black = cv2.cvtColor(im
我正在用 C#.net 做人脸检测项目,在某些情况下,我从 sobel 获得了更好的结果,而在其他一些情况下,我从 canny 获得了更好的结果。但实际上哪个更好? 最佳答案 Canny 建立在 So
我是一名优秀的程序员,十分优秀!