Lines Matching refs:width
5 def binary(n, width=None): argument
12 if width and width <= 0:
13 width = None
18 if width:
19 for i in range(width - len(l)):
26 def twos_complement(n, width): argument
31 val = 2**(width - 1)
36 return binary(n, width)
58 def positions(width): argument
62 return ['{0:2}'.format(i)[-2:] for i in reversed(range(width))]
73 width = None
75 width = int(args[1], 0)
76 if width < 0:
77 width = 0
87 bits = binary(n, width)
89 print("insufficient width value: %d" % width)
91 if verbose and width > 0:
92 pos = positions(width)
105 width = int(args[1], 0)
106 if width < 0:
107 width = 0
117 bits = twos_complement(n, width)
119 print("insufficient width value: %d" % width)
121 if verbose and width > 0:
122 pos = positions(width)