Data stored in the computer

  Written on a Von Neumann hardware structure of a computer, the first one is a memory for storing data and programs. Then this section to sort out the data in the computer is how to store.

First, the numbers in the computer memory of how

   We will be divided into integer numbers and real numbers are discussed

  1. Integer

            There are three storage methods: unsigned notation, the symbol plus absolute representation, complement notation

  • Not only for storing notation unsigned integer, illustrated as follows:

      

     

     

  • Add absolute representation symbol, the symbol representing the most significant bit is used, 0 for positive, 1 for negative. First absolute value is converted to binary, is less than n-1 bits 0s to the left, plus the most significant bit of the sign bit. Examples are as follows: 

          

 

     2. Real

   Real storage step are as follows: 1. First standardized, so that the left of the decimal move the decimal point is only a 1. 2. respectively sign, the exponent, the mantissa processing. 3. Connect the sign, the exponent, the mantissa

                  

     * More than coding system:

                

 

   I write to you or some obscure, here we are familiar with single-precision and double-precision look. First IEEE standard, a 32-bit single precision number is stored, with a 64-bit double precision number is stored.

   For single precision, the use to identify a symbol by using 8 bits store the exponent, stored in 32-bit mantissa

   For double precision, the use to identify a symbol, 11 bits to store the exponent, the mantissa is stored with 52

            

 

       For example as follows:

            

 

Second, the text in a computer is how to store

   Text can not be like that can be converted into a binary value, that is how we deal with it? The basic idea is: a binary number to map. We are familiar with the ASCII code is a kind of mapping correspondence. When beginning ASCII code is proposed by the Americans, in English only 26 letters plus some symbols, a total of 127, taking the highest bit to 8-bit binary number 0 will be able to complete the mapping, namely 00000000- -01111111 decimal 0--127.ASCII table is as follows:

   

 

   After the European ISO-8859-1 on the basis of ASCII, with the highest bit is 1 8-bit binary number. Called extended ASCII code table.

   That is how to store characters it? We know that there are thousands of Chinese characters, with 8-bit binary mapping is certainly not finished, so the use of two 16-bit bytes, also called full-width (ASCII half-angle)

   我们常用的编码表还有Unicode,其中更加转换规则的不同,又有UTF-8、UTF-16、UTF-32.

 

三、音频在计算机中是如何存储的

    因为音频会随着时间或空间连续的变化,存储时用的是模拟数据。涉及到声音的采样,所谓的采样就是选择采样的点来量度声音的值并记录下来。

       

      

 

    而采样率就是每秒的采样数目,之后再经过量化将样本的值四舍五入为一个整数的过程。再编码,如果样本值为正数用无符号表示法,如果样本值有负数就用符号加绝对值表示法。而用于存储样本所用的二进制位数称为 位深度。位率表示 每秒音频存储时所用的二进制位数(位率=位深度*采样率)

   例如:16b*40000个/s=640000b/s=78kB/s

  当今主流的音频编码标准是MPEG Layer3(MP3)

 

四、图像在计算机中是如何存储的

  图像的存储主要有两种:光栅图和矢量图

  1.光栅图

  • 模拟数据:图像的颜色随空间连续变化
  • 采样->扫描、样本->像素
  • 解析度: 每英寸图像采集多少个像素
  • 色彩深度:像素的位数,其中真彩色24位(可表示1677 7216种颜色),索引色8位(可以表示256种颜色)
  • 编码标准有:BMP、TIF、PNG、JPEG
  • 缺点:体积大、放大后会失真

  2.矢量图

  • 并不存储图像的像素,而是存储绘制图像的公式及颜色
  • 编码标准:DWG、DXF

 

 

   

Guess you like

Origin www.cnblogs.com/taoye1997/p/12097979.html