Lines Matching refs:width
3 def binary(n, width=None): argument
10 if width and width <= 0:
11 width = None
16 if width:
17 for i in range(width - len(l)):
24 def twos_complement(n, width): argument
29 val = 2**(width - 1)
34 return binary(n, width)
56 def positions(width): argument
60 return ['{0:2}'.format(i)[-2:] for i in reversed(range(width))]
71 width = None
73 width = int(args[1], 0)
74 if width < 0:
75 width = 0
85 bits = binary(n, width)
87 print("insufficient width value: %d" % width)
89 if verbose and width > 0:
90 pos = positions(width)
103 width = int(args[1], 0)
104 if width < 0:
105 width = 0
115 bits = twos_complement(n, width)
117 print("insufficient width value: %d" % width)
119 if verbose and width > 0:
120 pos = positions(width)