Verilog语言——HDLBits刷题记录(二)

Verilog语言——HDLBits刷题记录(二)

Vectors

Vectors
Build a circuit that has one 3-bit input, then outputs the same vector, and also splits it into three separate 1-bit outputs. Connect output o0 to the input vector's position 0, o1 to position 1, etc.

在这里插入图片描述

在这里插入图片描述

Vertors in more detail
Build a combinational circuit that splits an input half-word (16 bits, [15:0] ) into lower [7:0] and upper [15:8] bytes.

在这里插入图片描述

Vertor part select
A 32-bit vector can be viewed as containing 4 bytes (bits [31:24], [23:16], etc.). Build a circuit that will reverse the byte ordering of the 4-byte word.
AaaaaaaaBbbbbbbbCcccccccDddddddd => DdddddddCcccccccBbbbbbbbAaaaaaaa

在这里插入图片描述

Bitwise operators
Build a circuit that has two 3-bit inputs that computes the bitwise-OR of the two vectors, the logical-OR of the two vectors, and the inverse (NOT) of both vectors. Place the inverse of b in the upper half of out_not (i.e., bits [5:3]), and the inverse of a in the lower half.

在这里插入图片描述

在这里插入图片描述

PS:位操作与逻辑操作的区别

  位操作是两个N字节的向量,向量的每一位都进行操作,最终产生一个N字节的输出

  逻辑操作时两个N字节的向量,只要判断整体的bool值,产生一字节的输出

Four-input gates

在这里插入图片描述

在这里插入图片描述

Vector concatenation operator

在这里插入图片描述

在这里插入图片描述

Vector reversal 1
Given an 8-bit input vector [7:0], reverse its bit ordering.

在这里插入图片描述

Replication operator
Build a circuit that sign-extends an 8-bit number to 32 bits. This requires a concatenation of 24 copies of the sign bit (i.e., replicate bit[7] 24 times) followed by the 8-bit number itself.

在这里插入图片描述

More replication

在这里插入图片描述

在这里插入图片描述

总结

 以上就是这次刷题的记录的啦!!!  可以看出整体的难度也在不断地增大,特别是对英文题目的阅读,还是很有挑战性的!!!!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值