본문 바로가기

Verilog/HDLbits

[HDLBits] Reduction

1. 문제 및 설명

  • 8비트에 대한 패리티 비트를 계산하는 회로를 만드시오
    1. 짝수 패리티를 사용하시오
    2. 패리티 비트는 단순히 8개의 데이터 비트를 모두 XOR한 값이다.
     

2. 모듈 정의

module top_module (
    input [7:0] in,
    output parity);

 

 

 

3. 답

module top_module (
    input [7:0] in,
    output parity); 
    
    assign parity = ^in[7:0];

endmodule

'Verilog > HDLbits' 카테고리의 다른 글

[HDLBits] Vector100r  (0) 2025.12.07
[HDLBits] Gates100  (0) 2025.12.07
[HDLBits] Conditional  (0) 2025.12.07
[HDLBits] Always nolatches  (1) 2025.12.07
[HDLBits] Always casez  (0) 2025.12.07