Beispiel #1
0
    def __str__(self):
        s = 'load=%s, clk=%s, enable=%s\n' % (to_bit(
            self.load), to_bit(self.clk), to_bit(self.enable))
        s += 'Q'
        for i in range(self.__width, 0, -1):
            s = s + str(i)
        s += '\n '
        for i in range(self.__width, 0, -1):
            s = s + to_bit(self.q[i - 1])

        return s
Beispiel #2
0
    def __str__(self):
        s = 'E%s, D%s\n' % (to_bit(self.e), to_bit(self.d))

        for i in range(self.__width):
            s = s + 'D' + str(self.__width - i - 1) + ' '

        s = s + '\n'

        for i in range(self.__width):
            s = s + ' ' + to_bit(self.data[self.__width - i - 1]) + ' '

        return s
Beispiel #3
0
    def eval(self):
        bin_string = ''.join(map(lambda i: to_bit(i), self.a))
        self.out = int(bin_string, 2)

        print(self.out)
Beispiel #4
0
 def __str__(self):
     return "DEQQ\n%s%s%s%s" % (to_bit(self.d), to_bit(self.e), to_bit(self.q), to_bit(self.nq))
Beispiel #5
0
 def __str__(self):
     return "RSQQ\n%s%s%s%s" % (to_bit(self.r), to_bit(self.s), to_bit(self.q), to_bit(self.nq))
Beispiel #6
0
 def __str__(self):
     return 'X' + to_bit(self.b) + to_bit_arr(self.x) + '\nY ' + to_bit_arr(
         self.y) + '\nD ' + to_bit_arr(self.d)
Beispiel #7
0
 def __str__(self):
     q_str = ''
     for f in self.out:
         q_str += to_bit(f)
     return 'Q' * Counter.REG_WIDTH + '\n' + q_str
Beispiel #8
0
 def __str__(self):
     return 'A ' + to_bit_arr(self.a) + '\nB ' + to_bit_arr(self.b) + '\nC' + to_bit(self.c) + to_bit_arr(self.s)
Beispiel #9
0
 def __str__(self):
     return "NandGate{'a': %s, 'b': %s, 'q': %s}" % (to_bit(
         self.a), to_bit(self.b), to_bit(self.q))
Beispiel #10
0
 def __str__(self):
     return 'ABQ\n' + to_bit(self.a) + to_bit(self.b) + to_bit(self.q)
Beispiel #11
0
 def __str__(self):
     return "NorGate{'a': %s, 'q': %s}" % (to_bit(self.a), to_bit(self.q))