Package Modelica.​Electrical.​Digital.​Examples.​Utilities
Utility components used by package Examples

Information

This package contains utility components used by package Examples. Each component is built up hierarchically by components of the Gates package. In this way the Gates components were tested, and their usage is demonstrated.

Extends from Modelica.​Icons.​UtilitiesPackage (Icon for utility packages).

Package Contents

NameDescription
AdderGeneric N Bit Adder
CounterGeneric N Bit Counter
Counter33 Bit Counter
DFFD FlipFlop
FullAdderAdding circuit for binary numbers with input carry bit
HalfAdderHalf adder
JKFFJK FlipFlop
MUX44 to 1 Bit Multiplexer
RSUnclocked RS FlipFlop
RSFFUnclocked RS FlipFlop

Model Modelica.​Electrical.​Digital.​Examples.​Utilities.​MUX4
4 to 1 Bit Multiplexer

Information

MUX4 is a four bit multiplexer which is built up by And, Not, and Or gates according to the schematic.

The parameters delayTime and q0 are prepared but not yet used in the component. The MUX4 component uses standard values in its components.

Parameters

TypeNameDefaultDescription
TimedelayTime0.001Delay time
Logicq0L.​'0'Initial value

Connectors

TypeNameDescription
input DigitalInputd0 
input DigitalInputd1 
input DigitalInputd2 
input DigitalInputd3 
input DigitalInputa0 
input DigitalInputa1 
output DigitalOutputd 

Model Modelica.​Electrical.​Digital.​Examples.​Utilities.​RS
Unclocked RS FlipFlop

Information

RS is a basic component for e.g., the RS (set-reset) flipflop, which is built up by Nor gates according to the schematic. To avoid a numerical loop a small transport delay is inserted which delay time is a parameter of the RS component. Also its initial value can be set by parameter.

Parameters

TypeNameDefaultDescription
TimedelayTime0Delay time
Logicq0L.​'U'Initial value of output

Connectors

TypeNameDescription
input DigitalInputs 
input DigitalInputr 
output DigitalOutputq 
output DigitalOutputqn 

Model Modelica.​Electrical.​Digital.​Examples.​Utilities.​RSFF
Unclocked RS FlipFlop

Information

Basing on the RS component RSFF is a RS (set-reset) flipflop composed according the schematic. Its parameter delayTime is the delay time of the RS component transport delay, q0 is the initial value of that delay.

Parameters

TypeNameDefaultDescription
TimedelayTime0.01Delay time
Logicq0L.​'U'Initial value

Connectors

TypeNameDescription
input DigitalInputs 
input DigitalInputr 
output DigitalOutputq 
output DigitalOutputqnnot Q
input DigitalInputclk 

Model Modelica.​Electrical.​Digital.​Examples.​Utilities.​DFF
D FlipFlop

Information

Basing on the RS component DFF is a D flipflop composed according the schematic. Its parameter delayTime is the delay time of the RS component transport delay, q0 is the initial value of that delay.

Parameters

TypeNameDefaultDescription
TimeTdel0.01Delay time
LogicQInitL.​'U'Initial value

Connectors

TypeNameDescription
input DigitalInputd 
output DigitalOutputq 
output DigitalOutputqnnot Q
input DigitalInputclk 

Model Modelica.​Electrical.​Digital.​Examples.​Utilities.​JKFF
JK FlipFlop

Information

Basing on the RS component JKFF is a J-K-flipflop composed according the schematic. Its parameter delayTime is the delay time of the RS component transport delay, q0 is the initial value of that delay.

Parameters

TypeNameDefaultDescription
TimedelayTime0.001Delay time
Logicq0L.​'0'Initial value

Connectors

TypeNameDescription
input DigitalInputj 
output DigitalOutputq 
output DigitalOutputqnnot Q
input DigitalInputclk 
input DigitalInputk 

Model Modelica.​Electrical.​Digital.​Examples.​Utilities.​HalfAdder
Half adder

Information

HalfAdder is a two bit adder which is composed by Gates components.

Its logic behavior is like this:

HalfAdder behavior

input a

input b

sum s

carry c

0

0

0

0

1

0

1

0

0

1

1

0

1

1

0

1

The parameter delayTime is the delay time (tLH=tHL) of both the components.

Parameters

TypeNameDefaultDescription
RealdelayTime0Delay time

Connectors

TypeNameDescription
input DigitalInputb 
output DigitalOutputs 
input DigitalInputa 
output DigitalOutputc 

Model Modelica.​Electrical.​Digital.​Examples.​Utilities.​FullAdder
Adding circuit for binary numbers with input carry bit

Information

FullAdder is a two bit adder with additional carry in bit which is composed by Gates components.

Its logic behavior is like this:

FullAdder behavior

input a

input b

input carry c_in

sum s

output carry c_out

0

0

0

0

0

1

0

0

1

0

0

1

0

1

0

1

1

0

0

1

0

0

1

0

1

1

0

1

0

1

0

1

1

0

1

1

1

1

1

1

Connectors

TypeNameDescription
input DigitalInputa 
input DigitalInputb 
input DigitalInputc_in 
output DigitalOutputs 
output DigitalOutputc_out 

Model Modelica.​Electrical.​Digital.​Examples.​Utilities.​Adder
Generic N Bit Adder

Information

The Adder is a generic n bit adder which is composed as a chain of FullAdder components. n can be chosen by the user, a and b are the n bit input vectors, s is the sum vector, and c_out is the carry bit of the "highes" FullAdder. All components are built up by Gate components.

Parameters

TypeNameDefaultDescription
Integern2Number of single adders

Connectors

TypeNameDescription
input DigitalInputa[n] 
input DigitalInputb[n] 
input DigitalInputc_in 
output DigitalOutputs[n] 
output DigitalOutputc_out 

Model Modelica.​Electrical.​Digital.​Examples.​Utilities.​Counter3
3 Bit Counter

Information

The Counter3 counts the high-low slopes of the count signal, if the enable signal is set to be true. It is composed by three JK flipflops. q0, q1, and q2 are the bits of the resulting number, where q0 is the lowest, and q2 the highest bit.

Connectors

TypeNameDescription
input DigitalInputenable 
output DigitalOutputq2 
input DigitalInputcount 
output DigitalOutputq1 
output DigitalOutputq0 

Model Modelica.​Electrical.​Digital.​Examples.​Utilities.​Counter
Generic N Bit Counter

Information

The Counter is a generic component, which counts the high-low slopes of the count signal, if the enable signal is set to be true. It is composed by n JK flipflops. q is the resulting number, where q[0] is the lowest, and q[n] the highest bit.

Parameters

TypeNameDefaultDescription
Integern3Number of bits
TimedelayTime0.001Delay of each JKFF
Logicq0L.​'0'Initial value

Connectors

TypeNameDescription
input DigitalInputenable 
input DigitalInputcount 
output DigitalOutputq[n]