Professional Documents
Culture Documents
Inputs:
Output:
What It Does:
The Loop:
Function:
It selectively performs bitwise OR or NOR operations on two 4-bit input vectors (a and b), controlled by
the ctrl1 signal.
It outputs the result as a 5-bit vector (y), with the first 4 bits holding the operation's results and the last
bit fixed at 0 as place holder
Logic:
Control Check:
Function:
It selectively performs bitwise AND or NAND operations on 4-bit input vectors (a and b), based on the
control signal (ctrl).
It outputs the result as a 5-bit vector (y), with the first 4 bits holding the operation's results and the last
bit
Logic:
Control-Based Operation:
It adds two 4-bit binary numbers, producing a 5-bit output (to accommodate a potential carry).
Logic:
Carry Initialization: Starts with carry = 0 to handle the first bit addition.
Calculates each output bit (sum(i)) using XOR operations on a(i), b(i), and carry(i).
Calculates potential carry for the next bit (carry(i+1)) using logical AND/OR operations.
Final Carry Output: Assigns the last carry (carry(4)) to the highest output bit (sum(4)) to complete the 5-
bit sum
Function:
It performs either addition or subtraction on two 4-bit binary numbers (a and b), based on a control
signal (ctrl).
Logic:
Controlled Operation:
Carry/Borrow Initialization: Starts with cabo = 0 for the first bit calculation.
Calculates each output bit (cb(i)) using XOR operations on a(i), b(i), and cabo(i).
Calculates potential carry/borrow (cabo(i+1)) using logical AND/OR operations, adjusted for subtraction
when ctrl = 1.
Final Carry/Borrow Output: Assigns cabo(4) to cb(4) for the 5-bit result (