Paste: Summary
Author: | Author |
Mode: | gettext |
Date: | Mon, 2 Dec 2019 20:43:30 |
Plain Text |
#include <iostream>
int main()
{
int data = 0x53;
int tosend=((data<<4 | 0xF ) | 0x3000) & 0xF7F7;
std::cout<<std::hex<<tosend<<std::endl;
for (int i=0; i<14;i++){
std::cout<<(tosend & 0x01);
tosend =tosend >>1;
}
/*
7 bits :
11.0×××.××××.0111 (14)
((data<<4 | 0xF ) | 0x3000) & 0xF7F7
11.0xxx.xxxx.x111 (13)
((data<<3 | 0x7) | 0x3000) & 0xF7FF
8 bits :
110.xxxx.xxxx.1111 (15)
((data<<4 | 0xF ) | 0x6000)
11.0xxx.xxxx.x111 (14)
((data<<3 | 0x7 ) | 0x3000) & 0xF7FF
*/
}
New Annotation