Jutge.org
The Virtual Learning Environment for Computer Programming
Four bit half subtractor
X05606 en
Create a four bit half subtractor capable of calculating the difference between two signed
4-bit numbers encoded using two’s complement.
The root module must be called
sub
.
Input
x and y are four bit sized inputs each, encoded in two’s completement.
Output
w is the four bit output, in two’s complement (y
−
x)
b is the 1-bit output borrow.
ov f is a 1-bit signal that is raised if y
−
x cannot be encoded in four bits.
Problem information
Author : Javier de San Pedro Martín (on behalf of Marta Miralpeix)
Generation : 2013-07-17 16:31:15
© Jutge.org, 2006–2013.
http://www.jutge.org