Create class BinaryStore & Byte
overloaded +=in BinaryStore
overloaded + for Byte Class
overloaded - Byte Class
overloaded || for Byte Class
overloaded && for Byte Class
overloaded == Byte Class
int main()
{
// address 4 bit bytes 8 bit long
BinaryStore b1(10);
b1+="0011";
b1.Add("0011",Byte("00000010"));
cout<<b1;
b1+="0110";
b1.Add("0110",Byte("00000110"));
b1+="1010";
Byte nb=b1.Get("0011")+b1.Get("0110");
b1.Add("1010",nb);
Byte nb2=b1.Get("1010")+b1.Get("0110");
bool r=b1.Get("0011")==b1.Get("0110");
cout << r <<b1;
Byte nb3=b1.Get("1010");
bool r1=nb3==b1.Get("1010");
cout<< r1 ;
Byte nb4=b1.Get("0011") || b1.Get("1010");
Byte nb5("00001100");
Byte nb6= nb4 && nb5;
b1+="1011";
b1.Add("1011",nb6);
cout<<b1;
}
Comments
Leave a comment