Programmable Logic Array (PLA) Design - logic

I need to design Programmable Logic Array (PLA) circuit with given functions. How can I design circuit with POS form functions. Can someone explain that? enter image description here

Below is the design process completed for F, the other two outputs, G and H, can done in a similar fashon.
F Truth Table
A B C D # F G H
0 0 0 0 0 1
0 0 0 1 1 0
0 0 1 0 2 0
0 0 1 1 3 1
0 1 0 0 4 1
0 1 0 1 5 1
0 1 1 0 6 0
0 1 1 1 7 0
1 0 0 0 8 0
1 0 0 1 9 0
1 0 1 0 10 1
1 0 1 1 11 1
1 1 0 0 12 0
1 1 0 1 13 0
1 1 1 0 14 1
1 1 1 1 15 1
F Karnaugh Map:
AB\CD 00 01 11 10
\
----------
00 0 | 1 x 1 | 0
----------
--------
01 | 1 y 1 | 0 0
--------
----------
11 0 0 | 1 1 |
| z |
| |
10 0 0 | 1 1 |
----------
F Sum Of Product Boolean:
(A'B'D)+(A'BC')+(AC)
x y z ==>(for ref):
x=(A'B'D)
y=(A'BC')
z=(AC)
F Logic Circuit:
------- ------
A---NOT---| | ------- | |
| AND |---| | | |
B---NOT---| | | AND | x | |
------- | |--------------| |
D---------------------------| | | |
------- | |
| | F
------- | OR |---
A---NOT---| | ------- ------ | |
| AND |---| | y | | | |
C---NOT---| | | AND |---| | | |
------- | | | | y+z | |
B---------------------------| | | |-----| |
------- | OR | | |
------- | | | |
A---NOT---| | z | | | |
| AND |---------------------| | ------
C---NOT---| | | |
------- | |
------

Related

How can w’xz + w’yz + x’yz’ + wxy’z be implemented with 4 NOR gates (+ inverters), given d = wyz

How can you implement the following function with only four NOR gates and inverters:
F = w’xz + w’yz + x’yz’ + wxy’z
d = wyz
First get the Karnaugh map:
w’x z + w’ yz + x’yz’ + wxy’z
a b c e
wx\yz 00 01 11 10
---- c
00 0 0 | 1| |1 |
| b| ----
----|----
01 0 |a1 | 1|| 0
----|--|-
---
11 0 1e 0 0
---
10 0 0 0 |1 |
Then get the Product Of Sums:
wx\yz 00 01 11 10
| |
| |
00 | 0 0| 1 1
--------
------ -------
01 0| 1 1 | 0
| | A
| ---|
11 0| 1 |0|| 0
------ |C|--------
-------- | |
10 | 0 0| |0| 1
| | ---
| |
| B |
(x'+z)(x+y)(w'+y'+z')
A B C
Then reduce to utilize the available d =wyz pin, and to get the requested 4 nors:
=( (x'+z)(x+y) (w'+y'+z'))''
=(((x'+z)(x+y))(w'+y'+z'))''
=(((x'+z)(x+y))'+(w'+y'+z')')'
=(((x'+z)(x+y))'+(wyz))'
=(((x'+z)(x+y))'+d)'
=(((x'+z)'+(x+y)')+d)'
=(((x'+z)'+(x+y)')''+d)'
^ ^ ^ ^ 4 nors
^ ^ 2 inverters

Recording particular cell of a table on the basis of a certain condition using grep

I have a number of tables that looks as follows:
time | node | left |LP iter|LP it/n|mem/heur|mdpt |vars |cons |rows |cuts |sepa|confs|strbr| dualbound | primalbound | gap | compl.
0.0s| 1 | 0 | 100 | - | 1046k | 0 | 100 | 102 | 100 | 0 | 0 | 0 | 0 | -- | 9.999990e+05*| Inf | unknown
* 0.3s| 1 | 0 | 100 | - | LP | 0 | 200 | 102 | 100 | 0 | 0 | 0 | 0 | -- | 5.587300e+04 | Inf | unknown
12.0s| 1 | 0 | 239 | - | 1781k | 0 | 239 | 102 | 100 | 0 | 0 | 0 | 0 | 5.577800e+04 | 5.587300e+04 | 0.17%| unknown
12.1s| 1 | 0 | 287 | - | 2595k | 0 | 239 | 102 | 935 | 835 | 1 | 0 | 0 | 5.577800e+04 | 5.587300e+04 | 0.17%| unknown
66.8s| 1 | 0 | 422 | - | 3061k | 0 | 336 | 102 | 935 | 835 | 1 | 0 | 0 | 5.577800e+04 | 5.587300e+04 | 0.17%| unknown
89.4s| 1 | 0 | 481 | - | 3218k | 0 | 361 | 102 | 935 | 835 | 1 | 0 | 0 | 5.580100e+04 | 5.587300e+04 | 0.13%| unknown
89.5s| 1 | 0 | 579 | - | 3513k | 0 | 361 | 102 |1335 |1235 | 2 | 0 | 0 | 5.580100e+04 | 5.587300e+04 | 0.13%| unknown
100s| 1 | 0 | 715 | - | 3837k | 0 | 403 | 102 |1335 |1235 | 2 | 0 | 0 | 5.583250e+04 | 5.587300e+04 | 0.07%| unknown
I'm interested in recording the first numeric value in the gap column (second last column of the table). The gap column could either have Inf or x.xx% values in it. If all the values in the gap column are Inf, then I would simply record Inf, otherwise, I would like to record the first numeric value. For e.g. in the above table, the value that I would like to record is 0.17. I tried many different ways but couldn't achieve any success. It would be really great if someone could provide some guidance as to how to achieve the above-mentioned objective. Thanks !
You may use this awk solution:
awk -F '[[:blank:]]*\\|[[:blank:]]*' '
NR > 1 && (!v || v == "Inf") {
v = ($(NF-1) == "Inf" ? $(NF-1) : $(NF-1)+0)
}
END {
print v
}' file
0.17

Replace missing values by a reference value for each id in panel data

I have panel data:
Id | Wave| Localisation| Baseline
1 | 1 | AA | 1
1 | 2 | . | 0
1 | 3 | . | 0
2 | 2 | AB | 1
2 | 3 | . | 0
3 | 1 | AB | 1
3 | 3 | . | 0
4 | 2 | AC | 1
4 | 3 | . | 0
Some variable values of one panel (hhsize, localisation, whatever) serves as a reference (these values are included in the baseline interview only).
By consequence, for each id we do not have all the information. For the id==1 for instance, we have missing values in the column Localisation for not-baseline-interview (baseline==0).
I would like to spread the baseline values to each panel. That is, I want to replace missing values . in column Localisation by Localisation given in the baseline interview for each id.
In fact, the information Localisation remain the same across different waves. So it is useful to know the localization for each wave for one person.
If the data pattern you present is the same for the entire dataset, then the following should work:
clear
input Id Wave str2 Localisation Baseline
1 1 AA 1
1 2 . 0
1 3 . 0
2 2 AB 1
2 3 . 0
3 1 AB 1
3 3 . 0
4 2 AC 1
4 3 . 0
end
bysort Id (Wave): replace Localisation = Localisation[1] if Localisation == "."
list, sepby(Id) abbreviate(15)
+-------------------------------------+
| Id Wave Localisation Baseline |
|-------------------------------------|
1. | 1 1 AA 1 |
2. | 1 2 AA 0 |
3. | 1 3 AA 0 |
|-------------------------------------|
4. | 2 2 AB 1 |
5. | 2 3 AB 0 |
|-------------------------------------|
6. | 3 1 AB 1 |
7. | 3 3 AB 0 |
|-------------------------------------|
8. | 4 2 AC 1 |
9. | 4 3 AC 0 |
+-------------------------------------+

Purpose of variables for multiplexer

I am to implement an 8-to-1 multiplexer using the variables m(1,3,5,6,8,13). The function is:
F(A,B,C,D) = A′B′C′D + A′B′CD + A′BC′D + A′BCD′ + AB′C′D′ + ABC′D
I feel I have a basic idea of how multiplexers work, however I'm not entirely sure what to do with the numbers given. I created a truth table with ABCD and plugged it into the function. Then I created the multiplexer based upon the output. (Which I got to be: D', D', D', D, D, 0, D', 0) The only thing I haven't done, and I can't figure out how to do, is the variables. How do they relate to the function and multiplexer?
A multiplexer works as a switch. It selects one of the available inputs I and based on the given address bits S sends the selected input's value on the output Z.
For example:
–––––––––––
| MUX | +-------++-----+-----++-----+
| | | index || a_1 | a_0 || f |
D_0 –––| I_0 | |---------------------------|
D_1 –––| I_1 Z |––– f | 0 || 0 | 0 || D_0 |
D_2 –––| I_2 | | 1 || 0 | 1 || D_1 |
D_3 –––| I_3 | | 2 || 1 | 0 || D_2 |
| | | 3 || 1 | 1 || D_3 |
| S | +-------++-----+-----++-----+
–––––––––––
| |
a_1 a_0
In the example the output function is defined:
f = ¬a_1⋅¬a_0⋅D_0 + ¬a_1⋅a_0⋅D_1 + a_1⋅¬a_0⋅D_2 + a_1⋅a_0⋅D_3
In your case, the output is described by the given function of four variables and the multiplexer is supposed to be an 8:1, so there will be three variables used as the address bits (a, b and c) and the fourth (d) as the partitioned off input signal – parameter of the function f(d) representing the output value.
f(a,b,c,d)=¬a⋅¬b⋅¬c⋅d + ¬a⋅¬b⋅c⋅d + ¬a⋅b⋅¬c⋅d + ¬a⋅b⋅c⋅¬d + a⋅¬b⋅¬c⋅¬d + a⋅b⋅¬c⋅d
index || a | b | c | d || f(a,b,c,d) | f(d)
---------------------------------------------
0 || 0 | 0 | 0 | 0 || 0 | d
1 || 0 | 0 | 0 | 1 || 1 | d
2 || 0 | 0 | 1 | 0 || 0 | d
3 || 0 | 0 | 1 | 1 || 1 | d
---------------------------------------------
4 || 0 | 1 | 0 | 0 || 0 | d
5 || 0 | 1 | 0 | 1 || 1 | d
6 || 0 | 1 | 1 | 0 || 1 | ¬d
7 || 0 | 1 | 1 | 1 || 0 | ¬d
---------------------------------------------
8 || 1 | 0 | 0 | 0 || 1 | ¬d
9 || 1 | 0 | 0 | 1 || 0 | ¬d
10 || 1 | 0 | 1 | 0 || 0 | 0
11 || 1 | 0 | 1 | 1 || 0 | 0
---------------------------------------------
12 || 1 | 1 | 0 | 0 || 0 | d
13 || 1 | 1 | 0 | 1 || 1 | d
14 || 1 | 1 | 1 | 0 || 0 | 0
15 || 1 | 1 | 1 | 1 || 0 | 0
The truth table has been reduced to 8 lines by partitioning the input signal d off. Now the number of rows matches the number of multiplexer's inputs.
index || a | b | c || f(d)
-----------------------------
0 || 0 | 0 | 0 || d
1 || 0 | 0 | 1 || d
2 || 0 | 1 | 0 || d
3 || 0 | 1 | 1 || ¬d
-----------------------------
4 || 1 | 0 | 0 || ¬d
5 || 1 | 0 | 1 || 0
6 || 1 | 1 | 0 || d
7 || 1 | 1 | 1 || 0
In the following picture is a graphical representation of the multiplex.
Multiplexer (MUX)
MUX is a data selector
It allows digital information from several sources be routed into one single line for transmission over the line to a destination
A B C D are the sources and Q is the output. a b are the data selectors
Here is the truth table for 4:1 multiplexer
a | b | Q
0 | 0 | A
0 | 1 | B
1 | 0 | C
1 | 1 | D
The output Q is
Q = A+B+C+B
A=a'b' , B = a'b , C=ab' , D= ab
Q = a'b' + a'b + ab' + ab

How to understand this style of K-map

I have seen a different style of Karnaugh Map for logic design. This is the style they used:
Anyone knows how this K-Map done? How to comprehend with this kind of map? Or how they derived from that equation from that map. The map is quite different from the common map like this:
The maps relate to each other this way, the only difference is the cells' (terms') indexes corresponding to the variables or the order of the variables.
The exclamation mark is only an alternative to the negation of a variable. !A is the same as ¬A, also sometimes noted A'.
!A A A !A ↓CD\AB → 00 01 11 10
+----+----+----+----+ +----+----+----+----+
!B | 1 | 0 | 1 | 0 | !D 00 | 1 | 1 | 1 | 0 |
+----+----+----+----+ +----+----+----+----+
B | 1 | 1 | 1 | 1 | !D ~ 01 | 1 | x | x | 1 |
+----+----+----+----+ +----+----+----+----+
B | x | x | x | x | D 11 | x | x | x | x |
+----+----+----+----+ +----+----+----+----+
!B | 1 | 1 | x | x | D 10 | 0 | 1 | 1 | 1 |
+----+----+----+----+ +----+----+----+----+
!C !C C C
If you are unsure, of the indexes in the given K-map, you can always check that by writing the corresponding truth-table.
For example the output value of the first cell in the "strange" K-map is equal to 1 if !A·!B·!C·!D (all variables in its negation), that corresponds with the first line of the truth-table, so the index is 0. And so on.
index | A B C D | y
=======+=========+===
0 | 0 0 0 0 | 1
1 | 0 0 0 1 | 1
2 | 0 0 1 0 | 0
3 | 0 0 1 1 | x ~ 'do not care' state/output
-------+---------+---
4 | 0 1 0 0 | 1
5 | 0 1 0 1 | x
6 | 0 1 1 0 | 1
7 | 0 1 1 1 | x
-------+---------+---
8 | 1 0 0 0 | 0
9 | 1 0 0 1 | 1
10 | 1 0 1 0 | 1
11 | 1 0 1 1 | x
-------+---------+---
12 | 1 1 0 0 | 1
13 | 1 1 0 1 | x
14 | 1 1 1 0 | 1
15 | 1 1 1 1 | x
You can use the map the same way you would use the "normal" K-map to find the implicants (groups), because all K-maps indexing needs to conform to the Gray's code.
You can see the simplified boolean expression is the same in both styles of these K-maps:
f(A,B,C,D) = !A·!C + A·C + B + D = ¬A·¬C + A·C + B + D
!A·!C is marked red,
A·C blue,
B orange
and D green.
The K-maps were generated using latex's \karnaughmap command and tikz library.
it's the same in principle just the rows and columns (or the variables) are in a different order
The red labels are for when the variable is true, the blue for when it's false
It's actually the same map, but instead of A they have C and instead of B they have A and instead of C they have D and instead of D they have B

Resources