TinyMicro ALU X67117


Statement
 

pdf   zip

Design the ALU of the TinyMicro. The ALU has two operands, a and b, and one result c. The operation of the ALU is determined by the 2-bit control signals Op as follows:

  • Op=00, c=a+bc=a+b.

  • Op=01, c=abc=a-b.

  • Op=10, c=bac=b-a.

  • Op=11, c=ac=a.

Design a parametrized NN-bit ALU with a default value of N=8N=8.

Specification

module ALU(a, b, Op, c);
    parameter N=8;
    input [N-1:0] a, b;
    input [1:0] Op;
    output [N-1:0] c;

Input

  • a and b are the two input operands.

  • Op indicates the type of operation.

Output

  • c is the result of the operation.

Information
Author
Jordi Cortadella
Language
English
Official solutions
Verilog
User solutions
Verilog