Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日.

Slides:



Advertisements
Similar presentations
第十二章 常微分方程 返回. 一、主要内容 基本概念 一阶方程 类 型 1. 直接积分法 2. 可分离变量 3. 齐次方程 4. 可化为齐次 方程 5. 全微分方程 6. 线性方程 类 型 1. 直接积分法 2. 可分离变量 3. 齐次方程 4. 可化为齐次 方程 5. 全微分方程 6. 线性方程.
Advertisements

第 12 章位运算 C 语言兼具高级语言及低级语言的特性,因此 适合编写系统软件。 C 语言具备低级语言的特性 就在于它能直接对硬件进行操作,即位运算。 所谓位运算是指,按二进制位进行的运算。 例如,将一个存储单元中各二进位左移或右移一 位等。
数据挖掘实验 1 Apriori 算法编程实现. 数据挖掘实验一 (20’) 实验目的:了解关联规则在数据挖掘中的 应用,理解和掌握关联挖掘的经典算法 Apriori 算法的基本原理和执行过程并完成程 序设计。 实验内容:对给定数据集用 Apriori 算法进行 挖掘,找出其中的频繁集并生成关联规则。
第二章 数据信息 自然语言 字 -  单词 -  句子-  语言 计算机语言 字符-  词法单位-  程序-  语言 ↑ 词法 文法.
计算机 在分析化学的应用 ( 简介 ) 陈辉宏. 一. 概述 信息时代的来临, 各门学科的研究方法都 有了新的发展. 计算机的介入, 为分析化学的进展提供了 一种更方便的研究方法.
Chapter 5 Number Represent and Arithmetic Ciacuit 逻辑电路及其完成的算术运算 (217)
编译程序 构造原理和实现技术 授课教师:吕江花. 第一章 编译程序概述 主要内容: 几个基本概念 编译器的工作过程概述 编译器各个阶段的功能描述 编译程序的实现途径.
两极异步电动机示意图 (图中气隙磁场形象地 用 N 、 S 来表示) 定子接三相电源上,绕组中流过三相对称电流,气 隙中建立基波旋转磁动势,产生基波旋转磁场,转速 为同步速 : 三相异步电动机的简单工作原理 电动机运行时的基本电磁过程: 这个同步速的气隙磁场切割 转子绕组,产生感应电动势并在 转子绕组中产生相应的电流;
主要内容  LR(0) 分析. 0 S→  E # E→  E+T E→  T T→  id T→  ( E ) 1 S→E  # E→E  +T 5 T→id  3 E→E+  T T→  id T→  (E) 4 E→E+T  9 E→T  6 T→(  E) E→
Graphene Double Quantum Dot Transport Property Zhan Su Jan. 12, 2011.
Chapter 1 Representing Data in a Computer
吉林大学远程教育课件 主讲人 : 杨凤杰学 时: 64 ( 第六十二讲 ) 离散数学. 最后,我们构造能识别 A 的 Kleene 闭包 A* 的自动机 M A* =(S A* , I , f A* , s A* , F A* ) , 令 S A* 包括所有的 S A 的状态以及一个 附加的状态 s.
Viterbi 算法 viterbi 实验要求:见 experiment3.doc – 将 TRUNC_LENGTH 取值为 4 , 8 , 16 , 32 , 64 ,看看程序运行结果会有什么变化并分析原 因。 – 将 NUMSIM 取值为 10 1 , 10.
分析化学与无机化学中溶液 pH 值计算的异同比较 谢永生  分析化学是大学化学系的一门基础课,课 时较少,其内容主要是无机物的化学分析。 分析化学是以无机化学作为基础的,我们 都是在已掌握一定的无机化学知识后才学 习分析化学 。所以在分析 化学的学习中会 重复许多无机化学内容,造成学习没有兴.
1 为了更好的揭示随机现象的规律性并 利用数学工具描述其规律, 有必要引入随 机变量来描述随机试验的不同结果 例 电话总机某段时间内接到的电话次数, 可用一个变量 X 来描述 例 检测一件产品可能出现的两个结果, 也可以用一个变量来描述 第五章 随机变量及其分布函数.
例9:例9: 第 n-1 行( -1 )倍加到第 n 行上,第( n-2 ) 行( -1 )倍加到第 n-1 行上,以此类推, 直到第 1 行( -1 )倍加到第 2 行上。
吉林大学远程教育课件 主讲人 : 杨凤杰学 时: 64 ( 第三十八讲 ) 离散数学. 第八章 格与布尔代数 §8.1 引 言 在第一章中我们介绍了关于集 合的理论。如果将 ρ ( S )看做 是集合 S 的所有子集组成的集合, 于是, ρ ( S )中两个集合的并 集 A ∪ B ,两个集合的交集.
第十一章 曲线回归 第一节 曲线的类型与特点 第二节 曲线方程的配置 第三节 多项式回归.
第三章 C 数据及其表达式 2 回顾  程序是为执行一项任务而编写的有序指令集  算法是解决问题的具体方法和步骤  流程图是算法的图形化表现形式  C 程序的编译和运行过程  编译器将源程序转换成机器能理解的程序  连接器用于连接相关的目标文件以生成可执行程序  进制间的转换  补码.
线性代数习题课 吉林大学 术洪亮 第一讲 行 列 式 前面我们已经学习了关 于行列式的概念和一些基本 理论,其主要内容可概括为:
吉林大学远程教育课件 主讲人 : 杨凤杰学 时: 64 ( 第二十五讲 ) 离散数学. 定理 群定义中的条件 ( 1 )和( 2 )可以减弱如下: ( 1 ) ’ G 中有一个元素左壹适合 1 · a=a; ( 2 ) ’ 对于任意 a ,有一个元素左逆 a -1 适 合 a -1 ·
第 4 章 过程与变量的作用范围. 4.1 Visual Basic 的代码模块 Visual Basic 的应用程序是由过程组成的, 过程代码存放在模块中。 Visual Basic 提供了 三类模块,它们是窗体模块、标准模块和类 模块。 窗体模块 窗体模块是大多数 Visual Basic.
数 学 系 University of Science and Technology of China DEPARTMENT OF MATHEMATICS 第 3 章 曲线拟合的最小二乘法 给出一组离散点,确定一个函数逼近原函数,插值是这样的一种手段。 在实际中,数据不可避免的会有误差,插值函数会将这些误差也包括在内。
吉林大学远程教育课件 主讲人 : 杨凤杰学 时: 64 ( 第三十九讲 ) 离散数学. 例 设 S 是一个集合, ρ ( S )是 S 的幂集合,集合 的交( ∩ ),并(∪)是 ρ ( S )上的两个代数运算, 于是,( ρ ( S ), ∩ ,∪) 是一个格。而由例 知.
实验三: 用双线性变换法设计 IIR 数字滤波器 一、实验目的 1 熟悉用双线性变换法设计 IIR 数字滤波器的原理与方法。 2 掌握数字滤波器的计算机仿真方法。 3 通过观察对实际心电图信号的滤波作用, 获得数字滤波的感性知 识。
大亚湾 PMT 读出电子学介绍 王铮 中科院 “ 核探测技术与核电子学重点实验室 ” 年会.
外文文献检索示例. 实验目的: 掌握利用计算机网络检索外文文献的基本方法; 了解熟悉下列数据库的结构、内容并掌握其检索方 法 ; 掌握检索的主要途径:出版物( Publication )、关键 词( Keyword )、作者( Author )等。
OS 进程调度模拟演示 制作人: 钱晶 高上上. OS 进程调度模拟-实验原理 静态优先级原理 在这种方式下,系统一旦把处理机分配给就绪队 列中的优先权最高的进程后,该进程便一直执行下去, 直至完成。或因为发生某事件使该进程放弃处理机,系 统方可再将处理机分配给另一优先级最高的进程。这些 事件包括有优先级更高的进程进入,或是因为某些原因.
量子化学 第四章 角动量与自旋 (Angular momentum and spin) 4.1 动量算符 4.2 角动量阶梯算符方法
数 学 系 University of Science and Technology of China DEPARTMENT OF MATHEMATICS 第 5 章 解线性方程组的直接法 实际中,存在大量的解线性方程组的问题。很多数值方 法到最后也会涉及到线性方程组的求解问题:如样条插值的 M 和.
从 Postscript 格式文献中提取 数学公式的方法. 概述 从 Postscript 格式文献中提取识别数学公式, 是数学公式识别领域的一个研究方向。主要针对 以 Word 和 Latex 为生成源的 Postscript 文档, 提出 基于内容的数学公式提取方法。首先重载 Postscript.
主讲教师:陈殿友 总课时: 124 第十一讲 极限的运算法则. 第一章 二、 极限的四则运算法则 三、 复合函数的极限运算法则 一 、无穷小运算法则 机动 目录 上页 下页 返回 结束 §5 极限运算法则.
在发明中学习 线性代数 概念的引入 李尚志 中国科学技术大学. 随风潜入夜 : 知识的引入 之一、线性方程组的解法 加减消去法  方程的线性组合  原方程组的解是新方程的解 是否有 “ 增根 ” ?  互为线性组合 : 等价变形  初等变换  高斯消去法.
電腦的基本單位 類比訊號 (analog signal) 指的是連續的訊號 數位訊號 (digital signal) 指的是以預先定義的符號表示不連續 的訊號 one bit 8 bits=one byte 電腦裡的所有資料,包括文 字、數據、影像、音訊、視 訊,都是用二進位來表示的。
電腦的基本單位 類比訊號 (analog signal) 指的是連續的訊號
第一节 相图基本知识 1 三元相图的主要特点 (1)是立体图形,主要由曲面构成; (2)可发生四相平衡转变; (3)一、二、三相区为一空间。
第5章 键盘与鼠标接口 5.1 键盘概述 5.2 键盘的工作原理 5.3 PC扩展键盘接口 5.4 键盘中断与键盘I/O 5.5 鼠标接口.
9的乘法口诀 1 .把口诀说完全。 二八( ) 四六( ) 五八( ) 六八( ) 三七( ) 三八( ) 六七( ) 五七( ) 五六( ) 十六 四十八 四十二 二十四 二十一 三十五 四十 二十四 三十 2 .口算, 并说出用的是哪句口诀。 8×8= 4×6= 7×5= 6×8= 5×8=
第二章 处理器管理 南通大学电子信息学院 2010 年 9 月. 第二章 处理器管理 2.1 中央处理器 2.2 中断技术 2.3 进程及其实现 2.4 线程及其实现 2.5 Linux 进程和线程 2.6 Windows 2003 进程和线程 2.7 处理器调度 2.8 作业的管理与调度 2.9.
第 3 章 控制流分析 内容概述 – 定义一个函数式编程语言,变量可以指称函数 – 以 dynamic dispatch problem 为例(作为参数的 函数被调用时,究竟执行的是哪个函数) – 规范该控制流分析问题,定义什么是可接受的控 制流分析 – 定义可接受分析在语义模型上的可靠性 – 讨论分析算法.
吉林大学远程教育课件 主讲人 : 杨凤杰学 时: 64 ( 第五十三讲 ) 离散数学. 定义 设 G= ( V , T , S , P ) 是一个语法结构,由 G 产生的语言 (或者说 G 的语言)是由初始状态 S 演绎出来的所有终止符的集合, 记为 L ( G ) ={w  T *
实验三: 用双线性变换法设计 IIR 数字滤波器 一、实验目的 1 熟悉用双线性变换法设计 IIR 数字滤波器的原理与方法。 2 掌握数字滤波器的计算机仿真方法。 3 通过观察对实际心电图信号的滤波作用, 获得数字滤波的感性知 识。
编译原理总结. 基本概念  编译器 、解释器  编译过程 、各过程的功能  编译器在程序执行过程中的作用  编译器的实现途径.
报告人:黄磊 缓冲溶液的积分缓冲容量. 缓冲指数的概念是 Vanslyke 在 1922 年提出 的,意义是当缓冲溶液改变一个单位时需 加入酸碱物质的量 即 这里的缓冲指数指的是微分缓冲容量,是 加酸碱物质的量随着 pH 值的变化率 1 ,微分缓冲容量.
 符号表  标识符的作用: 声明部分:定义了各种对象及对应的属性和 使用规则。 程序体:对所定义的对象进行各种操作。 $ididname IdnameAttributeIR  必要性 Token : 新表-符号表(种类、类型等信息):
Department of Mathematics 第二章 解析函数 第一节 解析函数的概念 与 C-R 条件 第二节 初等解析函数 第三节 初等多值函数.
Chapter 2 Introduction to Number System & Data Formats.
网上预约集港操作指南 一、登录系统 登陆下面图片显示网址:输入堆场用户名、密码和校验码登陆系统.
首 页 首 页 上一页 下一页 本讲内容本讲内容 视图,剖视图(Ⅰ) 复习: P107 ~ P115 作业: P48(6-2,6-4), P49( 去 6-6) P50, P51(6-13), P52 P50, P51(6-13), P52 P53 (6-18,6-20) P53 (6-18,6-20)
《 UML 分析与设计》 交互概述图 授课人:唐一韬. 知 识 图 谱知 识 图 谱知 识 图 谱知 识 图 谱.
Introduction to Automatic Control The Laplace Transform Li Huifeng Tel:
Chapter 7 Logic Circuits Electrical Engineering and Electronics II Scott.
Chapter four – The 80x86 Instruction Set Principles of Microcomputers 2015年10月19日 2015年10月19日 2015年10月19日 2015年10月19日 2015年10月19日 2015年10月19日 1 Chapter.
LOGO s 数控机床故障诊断与维修. 子项目 8 掌握 M 、 T 代码的工作原理并进行控制 冷却、转速、刀库等 。 任务 8.3 编制斗笠式刀库换刀 PLC 程序,排除故障.
1 、如果 x + 5 > 4 ,那么两边都 可得 x >- 1 2 、在- 3y >- 4 的两边都乘以 7 可得 3 、在不等式 — x≤5 的两边都乘以- 1 可得 4 、将- 7x — 6 < 8 移项可得 。 5 、将 5 + a >- 2 a 移项可得 。 6 、将- 8x < 0.
名探柯南在侦查一个特大盗窃集团过程 中,获得藏有宝物的密码箱,密码究竟 是什么呢?请看信息: ABCDEF( 每个字 母表示一个数字 ) A :是所有自然数的因数 B :既有因数 5 ,又是 5 的倍数 C :既是偶数又是质数 D :既是奇数又是合数 EF :是 2 、 3 、 5 的最小公倍数.
Chapter 3 Programming Languages Unit 1 The Development of Programming Languages.
项目七: PLC 功能指令应用 带进位循环左移指令 XXXXX. 项目七: PLC 功能指令应用 FX2 系列可编程控制器移位控制指令有移位、循环移位、字移位 及先进先出 FIFO 指令等 10 条指令。 带进位循环右移指令 RCR 带进位循环左移指令 RCL 字右移位指令 WSFR 先入先出读出指令.
第四章 计算机数控( CNC )系统  本章重点:  1 计算机数控系统构成及其结构特点  2 运动轨迹插补原理  3 刀具补偿.
§10.2 对偶空间 一、对偶空间与对偶基 二、对偶空间的有关结果 三、例题讲析.
第三章 正弦交流电路.
力的合成 力的合成 一、力的合成 二、力的平行四边形 上一页下一页 目 录 退 出. 一、力的合成 O. O. 1. 合力与分力 我们常常用 一个力来代替几个力。如果这个 力单独作用在物体上的效果与原 来几个力共同作用在物体上的效 果完全一样,那么,这一个力就 叫做那几个力的合力,而那几个 力就是这个力的分力。
第四章 不定积分. 二、 第二类换元积分法 一、 第一类换元积分法 4.2 换元积分法 第二类换元法 第一类换元法 基本思路 设 可导, 则有.
算得清写的准 —— 物业费公示报告的编写 讲师:朱芸 物业费的 构成? 哪些是管 理人员工 资呢? 哪些算工程费 用? 怎样才能核 算的清楚呢?
逻辑设计基础 1 第 7 章 多级与(或)非门电路 逻辑设计基础 多级门电路.
1 第 4 章 速度瞬心及其应用 ● 利用速度瞬心进行机构的速度分析 ● 将低副机构转变为高副机构 ( 瞬心线机 构,共轭曲线机构) ● 用低副机构的分析方法对高副机构进 行结构和运动分析 ( 高副低代 )
1 第三章 数列 数列的概念 考点 搜索 ●数列的概念 ●数列通项公式的求解方法 ●用函数的观点理解数列 高考 猜想 以递推数列、新情境下的 数列为载体, 重点考查数列的通 项及性质, 是近年来高考的热点, 也是考题难点之所在.
目录 上页 下页 返回 结束 二、无界函数反常积分的审敛法 * 第五节 反常积分 无穷限的反常积分 无界函数的反常积分 一、无穷限反常积分的审敛法 反常积分的审敛法  函数 第五章 第五章.
Each digit appearing to the left of the decimal point represents a value between zero and nine times an increasing power of ten. Digits appearing to the.
Lecture 6: Functions of Combinational Logic
Presentation transcript:

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 1 Chapter Two Data Numbering and Character Encoding System in Microcomputer 计算机中的数制和编码 ( 1 )

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2 本章内容简介 计算机的基本功能是进行数据和信息的处理。数 据、信息以及为处理这些数据和信息而编写的程序 代码等都必须输入到计算机中。由于电子器件容易 实现对两种状态的表示,因此计算机中的数字、字 符和指令等一般都使用二进制编码来表示。 本章首先简要介绍无符号数的表示方法、各种数制 的相互转换以及二进制数的运算规则等;然后重点 介绍带符号数的表示方法、补码加减法运算以及运 算时溢出的判断方法;最后介绍十进制数的二进制 编码( BCD 编码)、字符(包括字母、数字和符 号)的 ASCII 编码以及数的定点和浮点表示方法 等。

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 3 本章主要内容 数字的表示 无符号数:十进制无符号数 二进制无符号数 十六进制无符号数 有(带)符号数: 原码表示法 反码表示法 补码表示法 机器数与真值的概念 补码运算溢出的判断方法 字符的表示 十进制数的二进制编码( BCD 编码) 英文字符(包括字母、数字和符号)的 ASCII 编码 (America Standard Code for Information Interchange) Please see an example about the numbering system in assembly program(21.asm)

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 4 Contents of chapter two 2.0 Chapter Overview 2.1 Numbering Systems –2.1.1 A Review of the Decimal System –2.1.2 The Binary Numbering System –2.1.3 Binary Formats 2.2 Data Organization –2.2.1 Bits Nibbles Bytes –2.2.4 Words Double Words 2.3 The Hexadecimal Numbering System 2.4 Arithmetic Operations on Binary and Hexadecimal Numbers 2.5 Logical Operations on Bits 2.6 Logical Operations on Binary Numbers and Bit Strings 2.7 Signed and Unsigned Numbers 2.8 Sign and Zero Extension 2.9 The ASCII Character Set 2.10 Summary

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Chapter Overview This chapter discusses several important concepts: the binary and hexadecimal numbering systems; binary data organization (bits, nibbles, bytes, words, and double words); signed and unsigned numbering systems; the ASCII character set; arithmetic, logical, shift, and rotate operations on binary values These are basic and very important concepts for understanding this course’s materials

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Numbering Systems Most modern computer systems do not represent numeric values using the decimal system (WHY?). Instead, they typically use a binary or two’s complement numbering system. Example: 16d= b=10h [+16] 补 = B=10H [-16] 补 = B=0F0H

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 A Review of the Decimal System You’ve been using the decimal (base 10) numbering system for so long that you probably take it for granted. When you see a number like “123”, you don’t think about the value 123; rather, you generate a mental image of how many items this value represents. In reality, however, the number 123 represents: 123=1* * * =1* * * * * *10 -3

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 The Binary Numbering System The binary numbering system works just like the decimal numbering system, with two exceptions: binary only allows the digits 0 and 1 (rather than 0-9), and binary uses powers of two rather than powers of ten. Therefore, it is very easy to convert a binary number to decimal. For each “1” in the binary string, add in 2 n where “n” is the zero-based position of the binary digit. For example, the binary value =1*2 7 +1*2 6 +0*2 5 +0*2 4 +1*2 3 +0*2 2 +1*2 1 +0*2 0 =202 10

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 The Binary Numbering System Convert decimal to binary 整数部分:除以基数( 2 )取余数,先为 低位后为高位。 小数部分:乘以基数( 2 )取整数,先为 高位(小数点后第一位)后为低位。 例: 12.75D=?

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Data Organization Bits Bytes Words Double Words

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Data Organization Bits Nibbles:A nibble is a collection of four bits. It wouldn’t be a particularly interesting data structure except for two items: BCD (binary coded decimal) numbers and hexadecimal numbers.It takes four bits to represent a single BCD or hexadecimal digit. With a nibble, we can represent up to 16 distinct values. In the case of hexadecimal numbers, the values 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F are represented with four bits (see “The Hexadecimal Numbering System” on page 17). BCD uses ten different digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) and requires four bits. In fact, any sixteen distinct values can be represented with a nibble, but hexadecimal and BCD digits are the primary items we can represent with a single nibble.

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Data Organization Bytes: Without question, the most important data structure used by the 80x86 microprocessor is the byte. A byte consists of eight bits and is the smallest addressable datum (data item) on the 80x86 microprocessor. Main memory and I/O addresses on the 80x86 are all byte addresses. This means that the smallest item that can be individually accessed by an 80x86 program is an eight-bit value. To access anything smaller requires that you read the byte containing the data and mask out the unwanted bits. The bits in a byte are normally numbered from zero to seven using the convention in Figure 2.1.( see the Text Book) Bit 0 is the low order bit or least significant bit, bit 7 is the high order bit or most significant bit of the byte. We’ll refer to all other bits by their number.

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Data Organization Words A word is a group of 16 bits. We’ll number the bits in a word starting from zero on up to fifteen. The bit numbering appears in the following Figure

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Data Organization Words

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Data Organization Double Words A double word is exactly what its name implies, a pair of words. Therefore, a double word quantity is 32 bits long as shown in the following Figure

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Data Organization Double Words

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 The Hexadecimal Numbering System A big problem with the binary system is verbosity The hexadecimal (base 16) numbering system can solve this problem. Hexadecimal numbers offer the two features we’re looking for: they’re very compact, And it’s simple to convert them to binary and vice versa.

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 The Hexadecimal Numbering System All hexadecimal values end with the letter “h”, e.g., 123A4h. All binary values end with the letter “b”. Decimal numbers may have a “d” suffix, which can also be omitted Examples of valid hexadecimal numbers: 1234h 0DEADh 0BEEFh 0AFBh 0FEEDh 0DEAFh Examples of valid binary numbers: B 1011b Examples of valid decimal numbers: 1234d 1234

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 The Hexadecimal Numbering System Table: Binary/Hex Conversion Binary Hexadecimal A 1011 B 1100 C 1101 D 1110 E 1111 F

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 The Hexadecimal Numbering System 例:十六进制数转化为十进制数 1A7BH=1* * * *16 0 = D 例 :十进制转化为十六进制 =7Dh 0.5=0.8h 125.5=7D.8H 二 进制转换为十六进制 =0F9D3.7EH 十 六进制转换为二进制 8A.8H= bB

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Arithmetic Operations on Binary and Hexadecimal Numbers 9h 10h + 1h - 1h 10h ? 9h ? Even if the two problems above don’t bother you, in a stressful situation your brain will switch back into decimal mode while you’re thinking about something else and you’ll produce the incorrect result. You should never perform binary arithmetic computations.

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Logical Operations on Bits AND OR XOR (exclusive-or) NOT

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Logical Operations on Binary Numbers and Bit Strings For example, if you want to compute the logical AND of the following two eight- bit numbers, you would perform the logical AND operation on each column independently of the others ^

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Signed and Unsigned Numbers For 16-bit numbers: 8000h is negative because the H.O. bit is one. 100h is positive because the H.O. bit is zero. 7FFFh is positive. 0FFFFh is negative. 0FFFh is positive.

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Signed and Unsigned Numbers If the H.O. bit is zero, then the number is positive and is stored as a standard binary value. If the H.O. bit is one, then the number is negative and is stored in the two’s complement form. To convert a positive number to its negative, two’s complement form, you use the following algorithm: 1) Invert all the bits in the number, i.e., apply the logical NOT function. 2) Add one to the inverted result. For example, to compute the eight bit equivalent of -5: Five (in binary) Invert all the bits Add one to obtain result.

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Signed and Unsigned Numbers why the two ’ s complement system is used in the computer For example, suppose you were to perform the addition 5+(-5). The result is zero. Consider what happens when we add these two values in the two’s complement system: We end up with a carry into the ninth bit and all other bits are zero. As it turns out, if we ignore the carry out of the H.O. bit, adding two signed values always produces the correct result when using the two’s complement numbering system. This means we can use the same hardware for signed and unsigned addition and subtraction. This wouldn’t be the case with some other numbering systems.

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Signed and Unsigned Numbers why the two ’ s complement system is used in the computer 计算机中带符号数用补码表示时有如下优点: ① 可以将减法运算变为加法运算,因此可使用同一个 运算器实现加法和减法运算,简化了电路。 补码加法运算规则: 补码加法运算规则: [x] 补 +[y] 补 =[x+y] 补 [x] 补 +[y] 补 =[x+y] 补 补码减法运算规则: 补码减法运算规则: [x] 补 -[y] 补 =[x] 补 +[-y] 补 =[x-y] 补 [x] 补 -[y] 补 =[x] 补 +[-y] 补 =[x-y] 补

Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 Signed and Unsigned Numbers why the two ’ s complement system is used in the computer [+66] 补 +[+51] 补 =? [+66] 补 −[+51] 补 =? 解: [+66] 补 B + [+51] 补 B [+117] 补 B = [66+51] 补 [+66] 补 B + [-51] 补 B [+15] 补 B = [66-51] 补