hcs12 microcontroller 笔记

文章来由

来到美国后,选了微处理器课,有幸老教授是 MIT 贝尔实验室出来的,希望好好学习这门课。

零、Chapter 0

第0章 绪论

0-2 Logic Gates

1、基础逻辑门(注意记住符号)

2、三态缓冲器

三态缓冲器(Three-state buffer),又称为三态门、三态驱动器,其三态输出受到使能输出端的控制,当使能输出有效时,器件实现正常逻辑状态输出(逻辑0、逻辑1),当使能输入无效时,输出处于高阻状态,即等效于与所连的电路断开。

3、Logic Design using Gates 为什么可以用 and 做 carry

?Note that there are 4 possible outcomes when adding a pair of binary numbers

?0 + 0 = carry 0, sum 0

?0 + 1 = carry 0, sum 1

?1 + 0 = carry 0, sum 1

?1 + 1 = carry 1, sum 0

?Recall that the AND gate only outputs 1 if both inputs are true, thus it could be used to output the carry bit.

?Recall that the XOR gate only outputs 1 if and only if one of the inputs are true.

4、半加器

另一种形式

5、全加器

6、三位全加器

Application of the previous 3 Bit Adder

?Assume we want to add the binary numbers 010 and 011..

?Using the truth table shows before..

?We know that 0+1 with no carry in will result in Sum of 1 with no carry

?Also, 1+1 with no carry in will result in sum of 0 with carry out of 1 ?Finally, 0+0 with carry in will result in sum of 1 with no carry

?Result is 0101

?The take away here is that we can cascade as many full adders as we want to add as large of a pair of binary numbers as we want.

?For example a 64 bit sum would require 64 cascaded adders

0-3 Semiconductor Memory(ROM、RAM类型)

1、Internal Organization of computers

?3 major subsystems

?CPU – Central Processing Unit ?Memory ?I/O Input Output

?Connected by buses

?Data ?Address ?Control

More About the Data Bus

?Analogous to Highway

?The more lanes, the more simultaneous traffic

?The more data buses the better

?This adds to expense

?Note that we currently have 64 bit CPUs and operating systems

?The size of the data bus is related to both size and precisions of arithmetic operations

More About the Address Bus

?Every addressable device must have a unique address

?The larger the address bus, the larger number of devices which may be addressed by the CPU

?Recall that decoders are used on addressable device to establish their address.

?The number of devices which may be addressed is always equal to 2^x where x is the number of address lines.

?For example, a 16 bit address bus can access 64k of addressable memory

?This is a unidirectional bus (send only from CPU)

2、Relation of CPU to RAM and ROM

3、Memory Capacity

?This is the number of bits a memory chip can store

?Chip capacity has units of bits, Computer system capacity has units of bytes

4、Memory Organization

?Memory chips are organized into a number of locations within the IC

?Each location can hold 1, 4, 8, 16, or more bits

?The number of bits that each location will hold is equal to the number of data

pins on the chip.

?The number of locations on the chip is determined by the number of address pins on the chip say x. 2^x is the number of locations (addresses) on the chip

?Total number of bits which may be stored on the entire chip is given by 2^(address pins) times the number of data pins

Another Organization/Capacity Example

?We have a chip with 256k capacity with 8 data pins.

?The organization is 256k/8 = 32K x 8 ?The number of address lines is 15 since 2^15 = 32K

5、不同ROM类型

Different types such as:

?PROM

?EPROM

?EEPROM

?FLASH EPROM

?MASK PROM

(1)PROM (programmable ROM) and OTP

(2)EPROM (erasable programmable ROM) and UV-EPROM

(3)Some UV-EPROM Memory Chips

(4)EEPROM (electrically erasable programmable ROM)

(5)Flash Memory EPROM

(6)Mask ROM

6、不同RAM类型

3 types

?Static RAM

?Nonvolatile RAM

?Dynamic Ram

(1)SRAM (static RAM)

(2)NV-RAM (nonvolatile RAM)

(3)DRAM (dynamic RAM)

7、Memory Block Selection

?Simple Logic Gates

?Using 74LS138

?Programmable Logic such as CPLD or FPGA

详见:http://blog.csdn.net/scythe666/article/details/52428243

Using the 74LS138 3 – 8 decoder

?One of the most widely used decoders ?3 inputs A, B, and C generate 8 active low outputs Y0 to Y7, ?Each output is connected to CS of a different memory device allowing

control of 8 memory blocks

?Three additional inputs G1, G2A, and G2B may connected to an Address or Control Signal

?G2A and G2B active low ?G1 active high ?These inputs must be terminated in way or another ?These inputs enable the device

0-4 Harvard and von Neumann CPU Architectures

一、Chapter 1

四、Chapter 4

1、分支语句集合

2、CCR register

3、Show how the cpu would subtract 05from43.

这个时候需要考虑到补码,43H-05H=3EH,也就是0100 0011 - 0000 0101,这个时候减去这个数相当于加上这个数的反码,0100 0011 + 1111 1011 = 0011 1110

五、Chapter 5

5-1

5-2 逻辑运算

NEG 是2的补码

5-3

本质是相减比较大小

5-4

5-5

5-6

When is the overflow flag set?

?Either of the following conditions cause V = 1

1. There is a carry from Bit 6 to Bit 7 but no carry from Bit 7

2. There is a carry from Bit 7 but no carry from Bit 6 to Bit 7

?Note in either case we do not have a carry from both

时间: 2024-11-05 19:04:44

hcs12 microcontroller 笔记的相关文章

USB库STM32F0x2移植到STM32F070笔记

1. 前言 ST官方提供的USB库STM32F0x2_USB-FS-Device_LibV1.0.0 是基于标准库的,适用于STM32F0x2系列MCU,但是对于STM32F070来说,就需要稍作修改,本文就一直到STM32F070作一个笔记. 2. 移植 从STM中文官网上下载STM32F0x2 USB库,地址:http://www.stmcu.org/document/detail/index/id-214961.用MDK打开,首先在Manager Project Items下的Projec

【安全牛学习笔记】

弱点扫描 ╋━━━━━━━━━━━━━━━━━━━━╋ ┃发现弱点                                ┃ ┃发现漏洞                                ┃ ┃  基于端口五福扫描结果版本信息(速度慢)┃ ┃  搜索已公开的漏洞数据库(数量大)      ┃ ┃  使用弱点扫描器实现漏洞管理            ┃ ╋━━━━━━━━━━━━━━━━━━━━╋ [email protected]:~# searchsploit Usage:

51CTO持续更新《通哥的运维笔记》

<通哥的运维笔记>将持续在51CTO网站更新,希望大家多多关注.互相学习,后期,我将会退出<通哥的运维笔记>系列视频教程,希望带给大家最大的收获,帮助大家更好的学习.进步.<通哥的运维笔记>主要从linux系统管理.虚拟化.cloudstack云平台以及网络管理之CCNA.CCNP.CCIE,等等方面深入讲解.

WPF笔记整理 - Bitmap和BitmapImage

项目中有图片处理的逻辑,因此要用到Bitmap.而WPF加载的一般都是BitmapImage.这里就需要将BitmapImage转成Bitmap 1. 图片的路径要用这样的,假设图片在project下的Images目录,文件名XXImage.png. pack://application:,,,/xxx;component/Images/XXImage.png 2. 代码: Bitmap bmp = null; var image = new BitmapImage(new Uri(this.X

java String 类 基础笔记

字符串是一个特殊的对象. 字符串一旦初始化就不可以被改变. String s = "abc";//存放于字符串常量池,产生1个对象 String s1=new String("abc");//堆内存中new创建了一个String对象,产生2个对象 String类中的equals比较字符串中的内容. 常用方法: 一:获取 1.获取字符串中字符的个数(长度):length();方法. 2.根据位置获取字符:charAt(int index); 3.根据字符获取在字符串中

vector 学习笔记

vector 使用练习: /**************************************** * File Name: vector.cpp * Author: sky0917 * Created Time: 2014年04月27日 11:07:33 ****************************************/ #include <iostream> #include <vector> using namespace std; int main

学习笔记之邮件发送篇

用脚本语言发送邮件是系统管理员必备技能 对系统定期检查或者当服务器受到攻击时生成文档和报表. 发布这些文档最快速有效的方法就是发送邮件. python中email模块使得处理邮件变得比较简单 发送邮件主要用到了smtplib和email两个模块,这里首先就两个模块进行一下简单的介绍: 本段摘录于    http://www.cnblogs.com/xiaowuyi/archive/2012/03/17/2404015.html 1.smtplib模块 smtplib.SMTP([host[, p

15.1-全栈Java笔记:Java事件模型是什么?事件控制的过程有哪几步??

应用前边两节上一章节的内容,大家可以完成一个简单的界面,但是没有任何的功能,界面完全是静态的,如果要实现具体功能的话,必须要学习事件模型. 事件模型简介及常见事件模型 对于采用了图形用户界面的程序来说,事件控制是非常重要的. 一个源(事件源)产生一个事件并把它(事件对象)送到一个或多个监听器那里,监听器只是简单地等待,直到它收到一个事件,一旦事件被接收,监听器将处理这些事件. 一个事件源必须注册监听器以便监听器可以接收关于一个特定事件的通知. 每种类型的事件都有其自己的注册方法,一般形式为: v

Java设计模式学习笔记,一:单例模式

开始学习Java的设计模式,因为做了很多年C语言,所以语言基础的学习很快,但是面向过程向面向对象的编程思想的转变还是需要耗费很多的代码量的.所有希望通过设计模式的学习,能更深入的学习. 把学习过程中的笔记,记录下来,只记干货. 第一部分:单例模式的内容 单例模式:类只能有一个实例. 类的特点:1.私有构造器:2.内部构造实例对象:3.对外提供获取唯一实例的public方法. 常见的单例模式实现有五种形式: 1.饿汉式. 2.懒汉式. 3.双重检查锁式. 4.静态内部类式. 5.枚举式. 以下分别