Menu
Coddy logo textTech

Recap - Logic Gate Circuit

CoddyのVerilogジャーニー「基礎」セクションの一部。レッスン 42/90。

challenge icon

チャレンジ

このチャレンジでは、この章で学んだ gate プリミティブに関するすべてを組み合わせます。複数の gate を使って回路を構築します。

行うこと:

次の回路を構築してください:

  • 入力: abc
  • 出力: out1out2out3

ロジック:

  1. out1 = a AND b
  2. out2 = b OR c
  3. out3 = a XOR c

gate プリミティブ(andorxor)を使って、これらの出力を作成してください。

自分で試してみよう

module logic_circuit (
  input a,
  input b,
  input c,
  output out1,
  output out2,
  output out3
);
  
  // TODO: out1用のANDゲートを追加 (a & b)
  
  // TODO: out2用のORゲートを追加 (b | c)
  
  // TODO: out3用のXORゲートを追加 (a ^ c)

endmodule

基礎のすべてのレッスン

自分で練習してみよう: Verilogオンラインコンパイラ