-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#========================================================================= | ||
# MinMaxUnit | ||
#========================================================================= | ||
# This module takes two inputs, compares them, and outputs the larger | ||
# via the "max" output port and the smaller via the "min" output port. | ||
|
||
from pymtl import * | ||
|
||
class MinMaxUnit( Model ): | ||
|
||
# Constructor | ||
|
||
def __init__( s, nbits=8 ): | ||
|
||
s.in0 = InPort ( nbits ) | ||
s.in1 = InPort ( nbits ) | ||
s.out_min = OutPort ( nbits ) | ||
s.out_max = OutPort ( nbits ) | ||
|
||
# ''' TUTORIAL TASK ''''''''''''''''''''''''''''''''''''''''''''''''''' | ||
# This model is incomplete. As part of the tutorial you will add | ||
# logic to implement the min/max unit. You should also write a unit | ||
# test from scratch named MinMaxUnit_test.py. | ||
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' | ||
|