Skip to content

Commit

Permalink
provide interface for MinMaxUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
cbatten committed Sep 3, 2015
1 parent 955b2b4 commit adfc399
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions sim/tut3_pymtl/sort/MinMaxUnit.py
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.
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

0 comments on commit adfc399

Please sign in to comment.