com.github.croesch.micro_debug.mic1.mpc
Class NextMPCCalculator

java.lang.Object
  extended by com.github.croesch.micro_debug.mic1.mpc.NextMPCCalculator

public final class NextMPCCalculator
extends Object

This class represents a calculator for the next micro-program-counter (MPC). It is based on the verilog code for 'calculation of MPC' in the script of the lecture 'Rechnertechnik' of Karl Stroetmann.

Since:
Date: Nov 7, 2011
Author:
croesch

Constructor Summary
NextMPCCalculator()
           
 
Method Summary
 void calculate()
          Performs calculation of the output signals based on the current values of input signals.
 int getMpc()
          Returns the calculated 9-bit-value.
 void setAddr(int newAddr)
          Sets the value of the Addr (MIR[35:27]).
 void setJmpC(boolean jmpCValue)
          Sets the value of the JMPC (MIR[26]).
 void setJmpN(boolean jmpNValue)
          Sets the value of the JMPN (MIR[25]).
 void setJmpZ(boolean jmpZValue)
          Sets the value of the JMPZ (MIR[24]).
 void setMbr(byte mbrValue)
          Sets the value of the register MBR.
 void setN(boolean nValue)
          Sets the value of the N - value fetched from the ALU.
 void setZ(boolean zValue)
          Sets the value of the Z - value fetched from the ALU.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NextMPCCalculator

public NextMPCCalculator()
Method Detail

calculate

public void calculate()
Performs calculation of the output signals based on the current values of input signals.

Since:
Date: Nov 7, 2011

getMpc

public int getMpc()
Returns the calculated 9-bit-value. This is the value for the next MPC.

Returns:
the 9-bit-value for the MPC
Since:
Date: Nov 7, 2011

setMbr

public void setMbr(byte mbrValue)
Sets the value of the register MBR.

Parameters:
mbrValue - the byte fetched from the register MBR
Since:
Date: Nov 7, 2011

setAddr

public void setAddr(int newAddr)
Sets the value of the Addr (MIR[35:27]).

Parameters:
newAddr - the value of the Addr fetched from the current control word
Since:
Date: Nov 7, 2011

setJmpC

public void setJmpC(boolean jmpCValue)
Sets the value of the JMPC (MIR[26]).

Parameters:
jmpCValue - the value of JMPC fetched from the current control word
Since:
Date: Nov 7, 2011

setJmpN

public void setJmpN(boolean jmpNValue)
Sets the value of the JMPN (MIR[25]).

Parameters:
jmpNValue - the value of JMPN fetched from the current control word
Since:
Date: Nov 7, 2011

setJmpZ

public void setJmpZ(boolean jmpZValue)
Sets the value of the JMPZ (MIR[24]).

Parameters:
jmpZValue - the value of JMPZ fetched from the current control word
Since:
Date: Nov 7, 2011

setN

public void setN(boolean nValue)
Sets the value of the N - value fetched from the ALU.

Parameters:
nValue - the value of N, fetched from the ALU
Since:
Date: Nov 7, 2011

setZ

public void setZ(boolean zValue)
Sets the value of the Z - value fetched from the ALU.

Parameters:
zValue - the value of Z, fetched from the ALU
Since:
Date: Nov 7, 2011


Copyright © 2012. All Rights Reserved.