← ProblemsVerification: Reading Simulations / Finding bugs in code

Add/sub

36%debuggingarithmeticconditionals

This adder-subtractor with a zero flag is supposed to compute out = a + b when do_sub is 0 and out = a - b when do_sub is 1, and assert result_is_zero exactly when out is zero.

The code below doesn't work. Find and fix the bug(s).