What are the commonly used base systems?
What are the commonly used base systems?
1. Binary
Binary is a number system widely used in computing technology. Two numbers can represent all numbers. Binary data uses two digits: 0 and 1. to represent the number. Its base is 2, the carry rule is "every two is forwarded to one", and the borrowing rule is "borrow one to be equal to two", which was discovered by Leibniz, the German master of mathematical philosophy in the 18th century.
The current computer system basically uses a binary system, and data is mainly stored in the computer in the form of two's complement code. The binary system in the computer is a very tiny switch, with "on" representing 1 and "off" representing 0.
2. The ternary system
The ternary system is a carry system with 3 as the base. The ternary system has three digits: 0, 1, and 2. Every three is entered into one. In the early days of computer development, a biased ternary system (symmetrical ternary system) was used, with three digits -1
3. Quaternary system
Quaternary system is a carry system with 4 as the base, using the four numbers 0, 1, 2 and 3 to represent any real number. Quaternary shares many properties with all fixed-base counting systems, such as the ability to represent any real number in a standard form and the ability to represent both rational and irrational numbers.
4. Octal
Octal, abbreviated OCT or O, a counting method based on 8 as the base, using 0, 1, 2, 3, 4, 5, 6, 7 Numbers enter 1 every eight. Some programming languages often start with the number 0 to indicate that the number is octal. Octal numbers and binary numbers can correspond bit by bit (one octal number corresponds to three binary digits), so they are often used in computer languages.
The above is the detailed content of What are the commonly used base systems?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Use the strconv.FormatInt function to convert an integer into a string in a specified base. In the Go language, the strconv package is a commonly used package for converting between strings and other data types. The strconv.FormatInt function can convert an integer into a string in a specified base. This article will introduce the use of strconv.FormatInt and provide some sample code. First, let's take a look at strconv.FormatIn

Title: Use PHP to convert strings to hexadecimal and achieve reverse output. In daily development, we sometimes need to convert strings to hexadecimal representation for data transmission or encryption. This article will introduce how to use PHP to convert a string into hexadecimal and realize the reverse output function. First, we need to write a PHP function to convert a string to hexadecimal. The following is an example code: functionstringToHex($string)

Methods to solve Chinese garbled characters when converting hexadecimal strings in PHP. In PHP programming, sometimes we encounter situations where we need to convert strings represented by hexadecimal into normal Chinese characters. However, in the process of this conversion, sometimes you will encounter the problem of Chinese garbled characters. This article will provide you with a method to solve the problem of Chinese garbled characters when converting hexadecimal to string in PHP, and give specific code examples. Use the hex2bin() function for hexadecimal conversion. PHP’s built-in hex2bin() function can convert 1

Title: Easily learn to convert hexadecimal to binary in Go language. Specific code examples are required. In computer programming, conversion operations between different base numbers are often involved. Among them, conversion between hexadecimal and binary is relatively common. In the Go language, we can achieve hexadecimal to binary conversion through some simple code examples. Let us learn together. First, let's take a look at the representation methods of hexadecimal and binary. Hexadecimal is a method of representing numbers, using 0-9 and A-F to represent 1

A number that contains all digits from 0 to base B is called a total number in that base. However, some numbers have digits from 1 to 9 and are called zero-free full digit numbers. Some examples of fully numeric numbers include 0123456789, 0789564312, etc. In this tutorial, we will discuss a problem where we are given a number and a base and we need to check if the number is a fully numeric number in the given base, for example -Input:num="9651723467380AZ",base=10Output: YESExplanation:numcontainsallthedig

Title: PHP converts a string to hexadecimal and reversely outputs it. In network programming, sometimes it is necessary to convert a string to hexadecimal format and restore the original string when outputting in reverse. As a popular server-side scripting language, PHP provides rich string processing functions and hexadecimal conversion functions, which can easily complete this task. This article will introduce how to convert a string to hexadecimal and reverse output through PHP, and provide specific code examples. Step 1: Convert string to hexadecimal First, we need to write a P

PHP octal: Decrypting the programmer's coding password Introduction: In the world of programmers, coding is one of the most basic skills. Coding enables computers to understand and execute our instructions to complete various tasks. However, sometimes programmers may need to encrypt data to ensure data security. Base encoding is one of the commonly used encryption methods. This article will introduce some common operations on base encoding in PHP8, as well as specific code examples. 1. What is hexadecimal encoding? Base is a mathematical counting system that

Title: Tips for dealing with converting hexadecimal to Chinese garbled characters in PHP programming. In the process of PHP programming, dealing with Chinese character encoding is a common challenge. Especially when converting hexadecimal to Chinese characters, it is easy to have garbled characters. This article will introduce some techniques for converting hexadecimal to Chinese garbled characters, and provide specific code examples for reference. 1. The problem of converting hexadecimal to Chinese characters. In network requests or database operations, sometimes Chinese characters represented by hexadecimal encoding are encountered, such as "u4F60u597D