search
HomeCommon ProblemWhat is used to store and operate data in computers?

The storage and operation of data in computers use "binary". Because binary numbers only have two basic symbols, "0" and "1", and computers are composed of logic circuits, logic circuits usually only have two states, the switch is on and off, and "1" can be used for these two states. and "0" indicates.

What is used to store and operate data in computers?

#Data in the computer is represented in binary. Data in computers can be divided into two categories according to their basic uses: numerical data and non-numeric data. Numerical data represents a specific quantity, which can be divided into positive and negative sizes. Non-numeric data mainly includes characters, sounds, images, etc. This type of data needs to be converted into binary representation using a specific encoding method before being stored and processed in the computer.

(1). The concept of base system

The base system is also the carry system, which is a carry method prescribed by people. For any base system - the X base system, it means that the number at a certain position is carried out by one digit every X. The decimal system advances by one after every tenth, the hexadecimal system advances by one after every hexadecimal, and the binary system advances by one after every two.

In a number system that uses carry counting, if only r basic symbols are used to represent values, then It is called the r-base (Radix-r Number System), and r is called the base (Radix) of the number system. The common characteristics of different number systems are as follows:

(1) Each number system has a certain set of symbols. For example, the decimal number system has ten basic symbols: 0,1,2...,9. There are two basic symbols of the binary number system: 0 and 1.

(2). Each number system uses positional representation. That is, the values ​​represented by the symbols in different positions are different, which are related to the weight of their position.

For example: 1234.55 in decimal can be expressed as

1234.55=1×10^3 2×10^2 3×10^1 4×10^0 5×10^(-1) 5 ×10^(-2)

It can be seen that the value of the weight in various carry counting systems is exactly a certain power of the base. Therefore, any number represented by a carry counting system can be written as a polynomial expanded according to weights.

(2) Why do we use binary in computers?

The use of binary in computers is determined by its implementation mechanism. We can understand it this way: the basic components of a computer are composed of integrated circuits, and these integrated circuits can be regarded as composed of gate circuits (of course, in fact it is not that simple).

When the computer is working, the circuit is powered on, so there is voltage at each output end. The voltage level is converted into binary through analog-to-digital conversion: high level is represented by 1, and low level is represented by 0. That is to convert analog circuits into digital circuits. The high level and low level here can be determined artificially. Generally, the low level is below 2.5 volts, and the high level is above 3.2 volts. Electronic computers can process and process information at extremely high speeds. , including data processing and processing, and has great information storage capabilities. Data is represented in the computer by the physical state of the device, using a binary number system. All characters or symbols processed by the computer must also be represented by binary encoding. The advantages of using binary are that it is easy to express, the operation rules are simple, and it saves equipment. People know that components with two stable states (such as the on and off of transistors, on and off of relays, the level of electrical pulses, etc.) are easy to find, but it is necessary to find components with 10 stable states to correspond Decimal 10 numbers are difficult

1) The technology is simple to implement. Computers are composed of logic circuits. Logic circuits usually only have two states, the switch is on and off. These two states can be used "1" and "0" are represented. (2) Simplified operation rules: There are three combinations of sum and product operations of two binary numbers. The operation rules are simple, which is conducive to simplifying the internal structure of the computer and improving the operation speed. (3) Suitable for logical operations: Logical algebra is the theoretical basis for logical operations. There are only two digits in binary, which coincides with "true" and "false" in logical algebra. (4) Easy to convert, binary and decimal numbers are easy to convert to each other. (5) Using binary to represent data has the advantages of strong anti-interference ability and high reliability. Because each bit of data has only two states: high and low, when it is disturbed to a certain extent, it can still be reliably distinguished whether it is high or low.

(3), the reason why octal and hexadecimal appear

The general way of human thinking is expressed in decimal, while computers are expressed in binary, but for programmers, We need to deal directly with the calculator, if we are given a large series of binary numbers. For example, a 4-byte int type data: 0000 1010 1111 0101 1000 1111 11111 1111. I think any programmer will be very upset when seeing such a large string of 0s and 1s. So there must be a more concise and flexible way to present this pair of data.

You may say, just use decimal. If that is the case, it cannot accurately express the way of computer thinking (binary). Therefore, octal and hexadecimal have appeared. In fact, hexadecimal is more widely used. For example, if the above int type data is directly converted to octal, 32./3 remainder 2 means that we have to add 0 in front, but it is different when converted to hexadecimal. 32/4=8, written directly as a string of 8 hexadecimal values, simple and clear.

So using hexadecimal to express binary strings is undoubtedly the best way, which is why octal and hexadecimal appear.

(4), the problem of mutual conversion between base systems

Commonly used base systems are binary, decimal, octal and hexadecimal

Conclusion between binary and decimal Conversion

Decimal to binary

The method is: divide the decimal number by 2 and take the remainder method, that is, divide the decimal number by 2, the remainder is the number in the weight position, and the obtained quotient value continues to be divided by 2, as follows This step continues until the quotient reaches 0.

(The specific usage is as shown below)

What is used to store and operate data in computers?

Binary to decimal conversion

The method is: expand the binary numbers according to the weight and add them up to get Decimal.

(The specific usage is as shown below)

What is used to store and operate data in computers?

Conversion between binary and octal

Binary to octal

Method It is: 3-digit binary numbers are added according to weight expansion to obtain 1-digit octal number. (Note: when converting 3-digit binary to octal, the conversion starts from right to left, and 0 is added when insufficient).

(The specific usage is as shown below)

What is used to store and operate data in computers?

Convert octal to binary

The method is: the octal number is divided by 2 and the remainder is obtained. Binary number, for each octal number, there are 3 binary numbers, and if there are insufficient numbers, zeros are added to the leftmost number.

(The specific usage is as shown below)

What is used to store and operate data in computers?

Conversion between binary and hexadecimal

Binary to hexadecimal

The method is: similar to the method of converting binary to octal. Octal converts three into one, and hexadecimal converts four into one. (Note, the conversion from 4-digit binary to hexadecimal is from right to left, and 0 is added when insufficient).

(The specific usage is as shown below)

What is used to store and operate data in computers?

Hexadecimal to binary

The method is: divide the hexadecimal number by 2 Use the remainder method to obtain a binary number. Each hexadecimal number is 4 binary numbers. If there is insufficient number, zeros are added to the leftmost number.

(The specific usage is as shown below)

What is used to store and operate data in computers?

Conversion between decimal, octal and hexadecimal

Convert decimal to octal or decimal There are two methods of hexadecimal

First: indirect method-convert decimal to binary, and then convert binary to octal or hexadecimal. There will no longer be any explanation of how to use pictures here.

Second: Direct method - Convert decimal to octal or hexadecimal by dividing by 8 or 16 and taking the remainder until the quotient is 0.

(The specific usage is as shown below)

What is used to store and operate data in computers?

Convert octal or hexadecimal to decimal

The method is: convert octal and hexadecimal The decimal number can be obtained by expanding the base numbers according to weight and adding them.

(The specific usage is as shown below)

What is used to store and operate data in computers?

Conversion between hexadecimal and octal

Between octal and hexadecimal There are two methods for conversion between them

The first one: the conversion between them can be converted to binary first and then converted to each other.

Second type: The conversion between them can be converted to decimal first and then converted to each other.

There will be no further explanation of picture usage here.

The above is the detailed content of What is used to store and operate data in computers?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
把逻辑地址转换为内存物理地址的过程称作什么把逻辑地址转换为内存物理地址的过程称作什么Jul 14, 2022 pm 02:52 PM

把逻辑地址转换为内存物理地址的过程称作“重定位”。程序发出的逻辑地址并不是数据或指令的真实存放地,但可以对这个地址进行转换来获得真实存放地的物理地址,相当于重新定位一次。

根据计算机网络覆盖范围,可将计算机网络分为哪几类根据计算机网络覆盖范围,可将计算机网络分为哪几类Jul 12, 2022 pm 05:13 PM

根据计算机网络覆盖范围,可将计算机网络分为三类:1、局域网(LAN),是一种在小区域内使用的,由多台计算机组成的网络,覆盖范围通常局限在10千米范围之内;2、广域网(WAN),是一种远程网,涉及长距离的通信,覆盖范围可以是个国家或多个国家,甚至整个世界;3、城域网(MAN),其网络覆盖范围通常可以延伸到整个城市,借助通信光纤将多个局域网联通公用城市网络形成大型网络。

微机的字长是4个字节这意味着什么微机的字长是4个字节这意味着什么Jul 08, 2022 pm 12:04 PM

微机的字长是4个字节意味着:在CPU中整体传输和处理的二进制数为32位。因为一个字节是8位长(字长),所以4个字节就是32位了,也就是说cpu中能够同时处理32位的二进制数据。在计算机领域,字是用来表示一次性处理事务的固定长度;一个字的位数,即字长,是计算机一次可处理的二进制数字的数目。

微型计算机的性能主要取决于什么微型计算机的性能主要取决于什么Jul 13, 2022 pm 03:40 PM

微型计算机的性能主要取决于CPU(中央处理器)的性能。CPU是计算机系统的运算和控制核心,是对计算机的所有硬件资源(如存储器、输入输出单元) 进行控制调配、执行通用运算的核心硬件单元;中央处理器(CPU)的性能对计算机性能起决定性作用。

微型计算机的运算器控制器及内存储器的总称是什么微型计算机的运算器控制器及内存储器的总称是什么Jul 14, 2022 pm 02:39 PM

微型计算机的运算器控制器及内存储器的总称是“主机”。在微型计算机中,运算器、控制器、存储器三个部分是信息加工、处理的主要部件;运算器和控制器总称为CPU(中央处理单元),而CPU与内存储器又总称为主机,这是计算机系统中最核心的硬件部分。

在计算机网络中使用MODEM时,它的功能是什么在计算机网络中使用MODEM时,它的功能是什么Jul 11, 2022 pm 12:02 PM

MODEM的功能为“实现模拟信号与数字信号之间的相互转换”。MODEM的中文名为“调制解调器”,它可以在发送端通过调制将数字信号转换成通信线路上传输的模拟信号,在接收端通过解调再将模拟信号转换为数字信号。

计算机系统的内部总线主要可以分为哪些计算机系统的内部总线主要可以分为哪些Jul 11, 2022 pm 02:38 PM

计算机系统的内部总线主要可以分为5类:1、数据总线,在CPU与RAM之间来回传送需要处理或是需要储存的数据;2、地址总线,用来指定在RAM之中储存的数据的地址;3、控制总线,将微处理器控制单元的信号,传送到周边设备;4、扩展总线,是外部设备和计算机主机进行数据通信的总线,例如ISA总线,PCI总线;5、局部总线,取代更高速数据传输的扩展总线。

世界上第一台计算机的电子元器件是啥世界上第一台计算机的电子元器件是啥Jul 05, 2022 am 10:37 AM

世界上第一台计算机的电子元器件是“电子真空管”。世界上第一台计算机是“阿塔纳索夫-贝瑞计算机”,通常简称ABC计算机,采用电子真空管作为电子元件;该计算机电路系统中装有300个电子真空管执行数字计算与逻辑运算,机器使用电容器来进行数值存储,数据输入采用打孔读卡方法,还采用了二进位制。

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software