summaryrefslogtreecommitdiff
path: root/2522/CH6/EX6.8/exm6_8.sce
blob: 00e371f86498de060755fe2e843092cd01f3f3b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
//page no 186
//example no 6.8
//KEEPING THE RADIO ON.
//to keep the radio on without affecting the other appliances, the D4 bit should always be 1
//assuming an input input binary 10101010
clc;
A=[1 0 1 0 1 0 1 0];
B=[0 0 0 1 0 0 0 0];
Y=bitor(A,B); //ORing input (A) with B to keep the D4 bit always set
disp(Y);
printf('D4 bit will always be one without affecting the other bits');