we are searching for the simplest implementation of this boolean logic function :
you can only use this logic elements : AND,OR,NOT,XOR.
thanks in advance.
Assuming this is the required truth table:
A B C D X
0 0 0 0 1
0 0 0 1 0
0 0 1 0 0
0 0 1 1 1
0 1 0 0 0
0 1 0 1 1
0 1 1 0 1
0 1 1 1 0
1 0 0 0 0
1 0 0 1 1
1 0 1 0 1
1 0 1 1 0
1 1 0 0 0
1 1 0 1 0
1 1 1 0 0
1 1 1 1 0
Then this seems to be the best implementation:
X = (A^B).(C^D) + (A'.B').(C^D)'
Related
I have a bar chart question here. Given that for all the variables in the dataset 1 = yes and 0 = No. I would like to plot a bar graph with the percentages (where var=1) on the y-axis and the variables on the x axis. Thanks in advance.
Dataset
Water
Ice
Fire
Vapor
1
1
0
1
1
0
0
1
0
1
1
1
1
1
1
1
1
1
0
1
1
1
1
0
0
1
1
1
0
1
0
1
0
1
1
1
1
0
1
1
0
1
0
0
0
1
1
0
1
0
1
0
1
0
1
0
1
1
1
1
0
1
0
1
1
0
1
1
1
0
1
0
1
1
0
1
1
0
0
1
0
1
1
1
1
1
0
1
1
0
0
1
0
1
1
1
The percent of 1s in a (0, 1) variable is just the mean multiplied by 100. As you probably want to see the percent as text on the graph, one method is to clone the variables and multiply each by 100.
You could then use graph bar directly as it defaults to showing means. I don't like its default in this case and the code instead uses statplot, which must be installed before you can use it.
* Example generated by -dataex-. For more info, type help dataex
clear
input byte(water ice fire vapor)
1 1 0 1
1 0 0 1
0 1 1 1
1 1 1 1
1 1 0 1
1 1 1 0
0 1 1 1
0 1 0 1
0 1 1 1
1 0 1 1
0 1 0 0
0 1 1 0
1 0 1 0
1 0 1 0
1 1 1 1
0 1 0 1
1 0 1 1
1 0 1 0
1 1 0 1
1 0 0 1
0 1 1 1
1 1 0 1
1 0 0 1
0 1 1 1
end
quietly foreach v of var water-vapor {
clonevar `v'2 = `v'
label var `v'2 "`v'"
replace `v'2 = 100 * `v'
}
* ssc install statplot
statplot *2 , recast(bar) ytitle(%) blabel(bar, format(%2.1f))
Try
. ssc install mylabels
checking mylabels consistency and verifying not already installed...
all files already exist and are up to date.
. sysuse nlsw88, clear
(NLSW, 1988 extract)
. mylabels 0(10)70, myscale(#/100) local(labels)
0 "0" .1 "10" .2 "20" .3 "30" .4 "40" .5 "50" .6 "60" .7 "70"
. graph bar (mean) married collgrad south union, showyvars legend(off) nolabel bargap(20) ylabel(`labels')
. table, statistic(mean married collgrad south union)
------------------------------
Married | .6420303
College graduate | .2368655
Lives in the south | .4194123
Union worker | .2454739
------------------------------
This relies on mylabels, and implements the bar gap (which I also like).
Question 2
A logic circuit is given two 2-bit binary numbers A and B as its inputs. The circuit consists of two outputs Y1 and Y2. The output values of YI and Y2 are obtained as follows:
If A<B, then Y1 and Y2 will be equal to A-B. Else Y1 and Y2 will be equal to A
a) Determine the truth table for the system
b) Obtain the simplified:
i SOP for Y1 and Y2.
ii. POS expressions for YI
Truth Table:
A1 A2 A B1 B2 B A<B? Y1=Y2=A-B||A Y11-Y21 Y12=Y22 Y13=Y23
0 0 0 0 0 0 n 0 0 0 0
0 0 0 0 1 1 y -1 1 1 1
0 0 0 1 0 -1 n 0 0 0 0
0 0 0 1 1 -2 n 0 0 0 0
0 1 1 0 0 0 n 1 0 0 1
0 1 1 0 1 1 n 1 0 0 1
0 1 1 1 0 -1 n 1 0 0 1
0 1 1 1 1 -2 n 1 0 0 1
1 0 -1 0 0 0 y -1 1 1 1
1 0 -1 0 1 1 y -2 1 1 0
1 0 -1 1 0 -1 n -1 1 1 1
1 0 -1 1 1 -2 n -1 1 1 1
1 1 -2 0 0 0 y -2 1 1 0
1 1 -2 0 1 1 y -3 1 0 1
1 1 -2 1 0 -1 y -1 1 1 1
1 1 -2 1 1 -2 n -2 1 1 0
Y11-Y21 K-MAP (Karnaugh map):
A1A2\B1B2 0 0 0 1 1 1 1 0
0 0 0 1 0 0
0 1 0 0 0 0
1 0 1 1 1 1
1 1 1 1 1 1
Y11-Y21 Sum Of Products:
A1 V (A1' ^ A2' ^ B1' ^ B2)
Y11-Y21 Product Of Sums:
(A1 v A2')^(B1' v A1)^(A1 v B1 v B2)
The rest is left was an exercise or for another Answerer.
Problem:
Given are k N x M dimensional matrices (e.g. M1 .. M5). Values are zero and ones only. How would you find all matrices that collide with a query matrix e.g. Q? Collision means if the query matrix have a "1" at the same position as the matrices from the database.
Example:
For this simple example the algorithm should find M1, M2, M3, M4 for the query but not M5 since there are not ones matching with the query matrix.
M1: M3:
+-----------------+ +-----------------+
| 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 1 |
| 0 1 1 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 |
| 0 1 1 0 0 1 1 0 | | 0 0 1 0 0 0 0 0 |
| 0 0 0 0 0 0 0 0 | | 0 0 1 0 0 0 0 1 |
+-----------------+ +-----------------+
M2: M4:
+-----------------+ +-----------------+
| 0 0 0 0 0 1 1 0 | | 0 0 0 0 0 0 0 0 |
| 0 0 1 1 0 0 0 0 | | 1 1 1 0 0 0 0 0 |
| 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 |
| 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 |
+-----------------+ +-----------------+
M5:
+-----------------+
| 0 0 0 0 0 0 0 0 |
| 0 0 0 0 1 0 0 0 |
| 0 0 0 0 0 1 0 0 |
| 0 0 0 0 0 0 0 0 |
+-----------------+
Q:
+-----------------+
| 0 0 0 0 0 0 0 0 |
| 0 0 1 0 0 0 0 0 |
| 0 0 1 0 0 0 0 0 |
| 0 0 0 0 0 0 0 0 |
+-----------------+
Naive solution:
Iterate over all matrices and do a bitwise AND:
Match:
M1: 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0
Q: 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
--------------------------------------------------------------------------
M1 && Q: 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
--------------------------------------------------------------------------
No match:
M5: 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
Q: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
--------------------------------------------------------------------------
M5 && Q: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
--------------------------------------------------------------------------
Questions:
Can this be done in sub-linear time?
Are there better algorithms than the given naive approach?
What would be a good way to store and query the matrix data in a database?
Note to question 3:
I thought about storing the integer values of the matrices in a MySQL table and use a MySQL bitwise query to find them. Would this work (scale) if the matrices become much bigger e.g. 100x100?
1 & 2. A sub linear ( < O(n*m) ) solution could be achieved using sparse matrix approaches and terminating at the first collision. Basically at each row you have a list of indexes that have a 1 and see if there is a collision. Technically this can be O(n*m) if the Q has 0's except for the last column of 1's and M is just the inverse of that.
3.The answer to this part depends on the restrictions of your system and how the matrices are composed. If the matrices are not sparse, and you are looking at memory usage you could store rows as a collection of ints that decompose to the 1's and 0's. If the matrices are sparse you could simply store a collection of points.
Construct another matrix, say P, of size N*M where every element is a bitset of size k. P(i,j) has the k-th bit set if the k-th matrix has 1 at (i,j). Given Q, start off with an empty k-bitset, Result. For every (i,j) such that Q(i,j)==1, do Result |= P(i,j). This algorithm requires O(k*N*M) preprocessing time. Every subsequent query runs in O(N*M*(number of 1s in Q)).
I needed some image-like illustration of something to do with IT, found an image of The Matrix characters and thought I might make that binary code and have it drop like it does in the movie.
So, should I use the code in my example (with hated MARQUEE tag (usually not a fan myself)), an animated GIF or are there better solutions other then not doing it at all ?
Are there any SEO problems when using MARQUEE (other then the effect it might have on visitors behavior on the website) ?
http://jsfiddle.net/fruLg/
CSS
#marq{ background-color: #000;
height: auto;
width: 27em;
}
#marqt{ font-family: Arial, Helvetica, sans-serif;
font-size: 0.7em;
color: #31B404;
}
#marqt td{ width: 0.7em;
}
HTML
<div id="marq">
<table id="marqt">
<td><marquee scrollamount="4" behavior="scroll" direction="down">0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1</marquee></td>
<td><marquee scrollamount="3" behavior="scroll" direction="down"> 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1</marquee></td>
<td><marquee scrollamount="5" behavior="scroll" direction="down">0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1</marquee></td>
<td><marquee scrollamount="2" behavior="scroll" direction="down">0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1</marquee></td>
<td><marquee scrollamount="4" behavior="scroll" direction="down"> 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0</marquee></td>
<td><marquee scrollamount="5" behavior="scroll" direction="down"> 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1</marquee></td>
<td><marquee scrollamount="2" behavior="scroll" direction="down">0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0</marquee></td>
<td><marquee scrollamount="4" behavior="scroll" direction="down"> 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0</marquee></td>
<td><marquee scrollamount="3" behavior="scroll" direction="down">0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1</marquee></td>
<td><marquee scrollamount="4" behavior="scroll" direction="down">0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1</marquee></td>
<td><marquee scrollamount="3" behavior="scroll" direction="down"> 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1</marquee></td>
<td><marquee scrollamount="5" behavior="scroll" direction="down">0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1</marquee></td>
<td><marquee scrollamount="2" behavior="scroll" direction="down">0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1</marquee></td>
<td><marquee scrollamount="4" behavior="scroll" direction="down"> 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0</marquee></td>
<td><marquee scrollamount="5" behavior="scroll" direction="down"> 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1</marquee></td>
<td><marquee scrollamount="2" behavior="scroll" direction="down">0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0</marquee></td>
<td><marquee scrollamount="4" behavior="scroll" direction="down"> 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0</marquee></td>
<td><marquee scrollamount="3" behavior="scroll" direction="down">0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1</marquee></td>
<td><marquee scrollamount="4" behavior="scroll" direction="down">0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1</marquee></td>
<td><marquee scrollamount="3" behavior="scroll" direction="down"> 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1</marquee></td>
<td><marquee scrollamount="5" behavior="scroll" direction="down">0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1</marquee></td>
<td><marquee scrollamount="2" behavior="scroll" direction="down">0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1</marquee></td>
<td><marquee scrollamount="4" behavior="scroll" direction="down"> 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0</marquee></td>
<td><marquee scrollamount="5" behavior="scroll" direction="down"> 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1</marquee></td>
<td><marquee scrollamount="2" behavior="scroll" direction="down">0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0</marquee></td>
<td><marquee scrollamount="4" behavior="scroll" direction="down"> 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0</marquee></td>
<td><marquee scrollamount="3" behavior="scroll" direction="down">0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1</marquee></td>
<td><marquee scrollamount="4" behavior="scroll" direction="down">0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1</marquee></td>
<td><marquee scrollamount="3" behavior="scroll" direction="down"> 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1</marquee></td>
<td><marquee scrollamount="5" behavior="scroll" direction="down">0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1</marquee></td>
<td><marquee scrollamount="2" behavior="scroll" direction="down">0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1</marquee></td>
<td><marquee scrollamount="4" behavior="scroll" direction="down"> 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0</marquee></td>
<td><marquee scrollamount="5" behavior="scroll" direction="down"> 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1</marquee></td>
<td><marquee scrollamount="2" behavior="scroll" direction="down">0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0</marquee></td>
<td><marquee scrollamount="4" behavior="scroll" direction="down"> 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0</marquee></td>
<td><marquee scrollamount="3" behavior="scroll" direction="down">0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1</marquee></td>
</table>
</div>
You can simply use CSS3 transitions with keyframes to animate single <span> elements with your desired text. This would be the modern way. Otherwise an animated image should be good either.
<marquee> should never be used because it's no standard.
Edit: See http://jsfiddle.net/yEsw6/
Not perfect but it's the beginning. :)
Could someone please help me understand what the boolean equation performed by this circuit would be?
Label the output of the first mux X.
Then, create a truth table for X, then Y:
C D X A Y
---------
0 0 1 0 1
0 1 0 0 0
1 0 0 0 0
1 1 1 0 1
0 0 1 1 1
0 1 0 1 1
1 0 0 1 1
1 1 1 1 1
From inspection of the truth table:
Y = A + CD + C'D'