#113. 位操作

    ID: 113 Type: Default 1000ms 256MiB

位操作

题目描述

创建一个电路,包含两个 3bit 的输入信号 a 和 b,分别对 ab 进行按位或、逻辑或操作,以及将 ab 拼接成 6bit 信号后进行按位取反,如下图所示: image

输入格式

a = 3'b101 b = 3'b000

输出格式

按位或:3'b101 逻辑或:1 拼接ab后再按位取反:6'b111010

示例代码

module top( 
    input [2:0] a,
    input [2:0] b,
    output [2:0] out_or_bitwise,
    output out_or_logical,
    output [5:0] out_not
);
  // Write your code here
endmodule