![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
位运算
Sanity12
这个作者很懒,什么都没留下…
展开
-
位运算总结 SDUT
今天学习了位运算,这是单片机所要用到的基础知识。1、按位与运算(&)可以取出某些特定位的信息(如:按下按键)例如:把0XA5中的A取出,因为A对应的二进制为1010,5对应的二进制为0101,则只需将和0XF0(1111 0010)进行按位与运算。1010 01011111 0000可得:1010 0000 ,A位取出!0&0=0 0&1=0 1...原创 2020-04-02 23:25:39 · 2068 阅读 · 0 评论 -
位运算(二)
一、位段#include <stdio.h>#include <stdlib.h>typedef unsigned char Uchar;typedef unsigned int Uint;union char_bin{ Uchar ch; struct { Uchar bit0 :1; Uchar bit1 :1; ...原创 2020-04-22 23:05:50 · 218 阅读 · 0 评论