some tricks about 2s complementary about mask address
来源:互联网 发布:zepto.js 左右滑动 编辑:程序博客网 时间:2024/05/29 12:41
some trick about the mack on calculation
1.we can just calulate the last bit that we needeg: 206.34.221.33/7we can just compute the last (8-7) bit on the first byte206%2==0 so last bit equals 0;eg2: 206.34.221.35/20
we can anology the first one we just compute previously
just compute the last (8*3-20) bit one the fourth byte
221%2==1. so we donote 1110%2==0 so we donote 0155%2==1 so we donote 10127%2==1 so we donote 110113%2==1 so we donote 11101
in practice ,we just need the last fourth bits ,to make clearly,we calculate the last fourth bits
so the mask is 206.34.(221-13=208).0
hope you can enjoy it
give the length of the mask ,calculate the mask addresseg: length=11we can split 11 equals 8 plus 3the first 8 bits are abvious ,i.e. 255the following 3 bits .we can think it like this way.(255-(2^5-1))=224.so the problem can be solved easily.
so if the length is 18we can easily write the mask address like this way.i.e.,the answer is 255.255.192.0
0 0
- some tricks about 2s complementary about mask address
- Some Tips and Tricks about Qt
- Some feelings about Wenkai's teaching video
- some thing about the kernel32.dll base address in X64
- Some words about ICE...
- About some techno-words
- some links about UML
- Some tutorial about geometry
- Some videos about Avalon
- Some Tips about Interbase
- some understanding about Java
- Some words about Computer
- some function about TIVOLI
- some about wcg
- some note about js
- some thing about JSon
- some words about "route"
- some tips about jsp
- codevs 3289 花匠 (dp + 线段树)
- 1063. 计算谱半径(20)
- java 是那么简单
- C++离航篇——函数默认参数、函数重载、内敛函数
- JAVA基础之循环语句(1)
- some tricks about 2s complementary about mask address
- Java常见异常总结
- LightOJ1030- Discovering Gold(期望dp)
- 第一篇博客——BitmapFactory Unable to decode stream 问题解决
- ubuntu hosts
- 浅谈jQuery源码(六)——$.map
- Java使用Comparable接口自定义排序
- 【Android 一般进阶】动态广播注册注销时机
- 后缀数组(suffix array) 模板(1)