예제 #1
0
파일: registers.py 프로젝트: paweusz/cpu
    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
예제 #2
0
파일: registers.py 프로젝트: paweusz/cpu
    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
예제 #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)
예제 #4
0
파일: latches.py 프로젝트: paweusz/cpu
 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))
예제 #5
0
파일: latches.py 프로젝트: paweusz/cpu
 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))
예제 #6
0
파일: subtractors.py 프로젝트: paweusz/cpu
 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)
예제 #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
예제 #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)
예제 #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))
예제 #10
0
 def __str__(self):
     return 'ABQ\n' + to_bit(self.a) + to_bit(self.b) + to_bit(self.q)
예제 #11
0
 def __str__(self):
     return "NorGate{'a': %s, 'q': %s}" % (to_bit(self.a), to_bit(self.q))