Chapter 6 binary, octal, and hexadecimal
6.1 why do we need octal and hexadecimal?
6.2 decimal number conversion to decimal number
6.2.1 convert binary to decimal
6.2.2 convert octal to decimal
6.2.3 expression of the octal number
6.2.4 use of Octal
6.1 why do we need octal and hexadecimal?
In programming, we usually use 10 hexadecimal notation ...... C/C ++ is a high-level language.
For example:
Int A = 100, B = 99;
However, because the representation of data in a computer exists in binary
Conversion between commonly used decimal, hexadecimal, string, and byte string in python (new post for a long time)
During protocol parsing, you will always encounter various data conversion problems, from binary to decimal, from byte string to
Conversion between commonly used decimal, hexadecimal, string, and byte string in python (updated for a long time)
During protocol parsing, you will always encounter various data conversion problems, from binary to decimal, from byte string to
Popular usage: each bit of binary represents a State.
001,010,100 indicates three states.
Through or | operations, you can combine various States.
001 | 010 = 011
001 | 010 | 100 = 111
You can remove a certain State through and & Operations.111 & 00
A summary of implementation of various hexadecimal conversions in python, and a summary of python
Preface
Ctf often encounters the problem of hexadecimal conversion. we just make a summary of hexadecimal conversion and share it for your reference.
Implement various hexadecimal conversions and hexadecimal conversions by yourself
In this article, we have implemented the conversion between hexadecimal numbers 2, 8, 10, and 16. In practice, APIs are rarely used or directly used.
If you are
One, the conversion between decimal and binary (1) Decimal conversion to binary, divided into integers and fractional parts ① whole number of parts Methods: In addition to the 2 method, that is, each time the integer part divided by 2, the remainder
Lists some of the operations used, including hexadecimal conversion and ASCII conversion.
I. Let's talk about the conversion between 2, 8, 10, and 16 hexadecimal formats.
The system. Convert class provides comprehensive conversion functions
Good stuff. Add it to favorites.
Bytes --------------------------------------------------------------------------------------------------------------------------
Another common format of Motorola S-records hexadecimal files, which is compiled by
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.