Lines Matching refs:width
4 def binary(n, width=None): argument
11 if width and width <= 0:
12 width = None
17 if width:
18 for i in range(width - len(l)):
25 def twos_complement(n, width): argument
30 val = 2 ** (width - 1)
35 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)