Vous êtes sur la page 1sur 22

Introduction to Digital Works

The Digital Works Window

Creating and using Macros

Converting the two-input multiplexer circuit into a black box

Creating the black box


Left click on the arrow.
Right click on one of the macro tags.
Select Template Editor from the menu with
a left click.
The Template Editor window appears. You
can create a symbol for your circuit.
There may already be a default black box
and if there is you can use it if you like, or
you can delete it and draw one that you
like.

Creating a symbol for the new circuit

Procedure for building the macro


Once you have drawn an object or decided to use the
default one you select the Pin Icon by left clicking.
You then place the cursor where you want it to be in the
diagram and left click to insert it.
Next select it and right click and select associate with tag
from the menu.
Next close the template editor. You will notice a 1 next to
the selected macro tag.
Now select another macro tag, right click and select
template editor and repeat the above procedure except
for drawing the template. Do this for the remaining macro
tags and then save the file. You do not use a separate
name for the macro.

Creating an interface point in the black box

The completed black box representation

The original circuit with the macro tags numbered

Using a Macro

Embedding a macro in a circuit

Using a Macro continued


You can use the push button interactive tool to
insert inputs to the macro and the LED tool to
insert outputs to the macro. You then wire the
interactive buttons and LEDs to the appropriate
macro icons. You can then run and test it.
Suppose you want to build a circuit having more
than one macro (which may or may not be the
same)
Select the embed macro button and position the
cursor to where you want it in the workspace
and left click.

Embedding two macros, wiring them together

Editing a macro in a circuit

Editing the expanded form of the macro

Decimal Codes
Decimal
digit
0

8421
code
0000

Excess-3
code
0011

0001

0100

2
3
4
5
6
7
8
9

0010
0011
0100
0101
0110
0111
1000
1001

0101
0110
0111
1000
1001
1010
1011
1100

Building a BCD adder


Adding two single decimal digits given in 8421 BCD code
can be accomplished by adding the 8421
representations as binary numbers. If there is no carry
then the sum digit is exactly the binary sum and
represents the 8421 representation of the two decimal
digits. If there is a carry then this carry bit corresponds
to 16 decimal and thus the correct two digit decimal
number can be determined by subtracting 6 from the 5th
bit making it a 10 and adding the 6 into the first digit
which is represented by the rightmost 4 digits.
For example a sum of 18, given as 1 0010 = 16 + 2. If
we count the leading 1 as the tens digit then we must
add 6 + 2 to get 10 + 8 = 18, i.e. 16 6 = 10 and 0010 +
0110 = 1000. Now the 1 0010 = 0001 1000 as a 8421
BCD 2 digit number.

Organization of a single-decade 8421 BCDdecimal adder.

Organization of a single-decade 8421 BCD adder.

Karnaugh map to detect the combinations


P3P2P1P0 = 1010, 1011, . . . , 1111.
P3P2 + P3P1 true
implies one of the
above combinations

A single-decade 8421 BCD adder.

Vous aimerez peut-être aussi