blob: b98eb23097c455ebb8b735e5b12ff332ee24dec4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
// exmple 2.3
clc
clear
close
a=[0 0 1 1];
b=[0 1 0 1];
for i=1:4
r(i)= bitor(bitcmp(a(i),1), bitcmp(b(i),1)) // given expression
end
disp(' A B Y')
for i = 1 : 4
Y(i,1)=a(i);
Y(i,2)=b(i);
Y(i,3)=r(i);
end
disp(Y); //displaying truth table
disp('''1'' represents a HIGH(H) and ''0'' represents a LOW(L)')
|