总线总线是连接各个部件的信息传输线,是 各个部件共享的传输介质
总线的分类片内总线芯片内部的总线
系统总线计算机各部件之间的信息传输线
数据总线双向 与机器字长、存储字长有关
地址总线单向(从cpu单向输出)与存储地址、 I/O地址有关
控制总线有出 有入中断请求、总线请求存储器读、存储器写总线允许、中断确认
通信总线用于 计算机系统之间 或 计算机系统与其他系统(如控制仪表、移动通信等)之间的通信传输方式串行通信总线并行通信总线
总线控制总线判优控制主设备(模块):对总线有 控制权从设备(模块):对总线有 控制权
链式查询连线简单,易于扩充,对电路故障最敏感
计数器定时查询优先级设置较灵活,对故障不敏感,连线及控制过程较复杂
独立请求方式响应速度快,优先级次序控制灵活,但连线多,总线控制复杂
分布式总线控制逻辑分布在连接总线的各部件或设备中.
总线通信控制同步通信(同步定时方式)由统一的时标控制数据传送
异步通信(同步定时方式)不互锁主设备发出请求信号,从设备发出应答信号,经过一定的延时,主设备不管有没有收到从设备的应答信号都会撤销请求信号,从设备也如此,不管 ...
数据模型它是对现实数据特征的抽象,数据模型是数据库系统的核心和基础。
概念模型按用户的观点对数据和信息进行建模
逻辑模型和物理模型逻辑模型层次模型(hierarchical model)有且只有一个节点没有双亲结点,这个节点称为根节点根以外的其他节点有且只有一个双亲节点
网状模型(network model)允许一个以上的节点没有双亲一个节点可以有多于一个双亲
关系模型(relational model)关系模型是指用二维表的形式表示实体和实体间联系的数据模型。(1)关系(Relation):一个关系对应着一个二维表,二维表就是关系名。(2)元组(Tuple):在二维表中的一行,称为一个元组。(3)属性(Attribute):在二维表中的列,称为属性。属性的个数称为关系的元或度。列的值称为属性值;(4)(值)域(Domain):属性值的取值范围为值域。(5)分量:每一行对应的列的属性值,即元组中的一个属性值。(6)关系模式:在二维表中的行定义,即对关系的描述称为关系模式。一般表示为(属性1,属性2,……,属性n),如老师的关系模型可以表示为教师(教师号,姓名,性别,年龄,职称,所在系) ...
sql基本语法增创建数据库1CREATE DATABASE database-name
表创建新表123create table 表名 (列名 数据类型 primary key(设置主键), 列名 数据类型 , 列名 数据类型 not null(不能设置空值))
创建索引1create [unique] index idxname on tabname(col….)
根据已有的表创建新表1create table tab_new as select col1,col2… from tab_old definition only
使用旧表创建新表1create table tab_new like tab_old
创建索引1create [unique] index idxname on tabname(col….)
将元素插入表1insert into table1(field1,field2) values(value1,value2)
创建视图1create view viewname ...
题目Common Subsequence
题面Cry对于泡妹子十分不熟练,在见到小姐姐后十分紧张,这时,他想起了czh对他的教诲,于是他决定尽可能找到自己与小姐姐的共同点。Cry靠他强大的人格魅力获取了小姐姐的基因片段,同时他也提供了自己的基因片段,现在我们假定,他们的公共点个数为两个片段的最长公共子序列中元素个数,cry有点方因为他完全不会做,他的幸福生活只能靠在座的各位了!
Input多组输入,每行有两个字符串,根据本czh的经验,如果对小姐姐问来问去是很失礼的一件事,因此每个基因片段长度最好不超过1000吧
Output每行一个答案,表示每组数据中他们的公共点个数
ExamplesInputabcfbc abfcabprogramming contestabcd mnp
Output420
思路这个题于poj1887有相似之处,寻找最长序列数因为这个题目有2个序列所以以一个为模板,逐个变化另一个字符串的开头字母,不断更新最后输出答案
代码123456789101112131415161718192021222324252627282930 ...
题目Max Sum
题面Given a sequence a[1],a[2],a[3]……a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.
InputThe first line of the input contains an integer T(1<=T<=20) which means the number of test cases. Then T lines follow, each line starts with a number N(1<=N<=100000), then N integers followed(all the integers are between -1000 and 1000).
OutputFor each test ca ...
题目题面Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子
1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813 12 11 10 9
一个人可以从某个点滑向上下左右相邻四个点之一,当且仅当高度减小。在上面的例子中,一条可滑行的滑坡为24-17-16-1。当然25-24-23-…-3-2-1更长。事实上,这是最长的一条。
Input输入的第一行表示区域的行数R和列数C(1 <= R,C <= 100)。下面是R行,每行有C个整数,代表高度h,0<=h<=10000。
Output输出最长区域的长度。
ExamplesInput5 51 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813 12 11 10 9
O ...
题目题面You want to arrange the window of your flower shop in a most pleasant way. You have F bunches of flowers, each being of a different kind, and at least as many vases ordered in a row. The vases are glued onto the shelf and are numbered consecutively 1 through V, where V is the number of vases, from left to right so that the vase 1 is the leftmost, and the vase V is the rightmost vase. The bunches are moveable and are uniquely identified by integers between 1 and F. These id-numbers have a sig ...
题目题面Maximum sumTime Limit: 1000MSMemory Limit: 65536KDescription
Given a set of n integers: A={a1, a2,…, an}, we define a function d(A) as below:Your task is to calculate d(A).
InputThe input consists of T(<=30) test cases. The number of test cases (T) is given in the first line of the input.Each test case contains two lines. The first line is an integer n(2<=n<=50000). The second line contains n integers: a1, a2, …, an. (|ai| <= 10000).There is an empty line ...
题目题面Cards Sorting
Vasily has a deck of cards consisting of n cards.There is an integer on each of the cards, this integer is between 1 and 100 000, inclusive .It is possible that some cards have the same integers on them.
Vasily decided to sort the cards .To do this, he repeatedly takes the top card from the deck, and if the number on it equals the minimum number written on the cards in the deck, then he places the card away.Otherwise, he puts it under the deckand takes the next card from the to ...
题目题面You are given an array a1,a2,…,an and two integers m and k.
You can choose some subarray al,al+1,…,ar−1,ar.
The cost of subarray al,al+1,…,ar−1,ar is equal to ∑i=lrai−k⌈(r−l+1)/m⌉, where ⌈x⌉ is the least integer greater than or equal to xx.
The cost of empty subarray is equal to zero.
For example, if m=3m=3, k=10k=10 and a=[2,−4,15,−3,4,8,3]a=[2,−4,15,−3,4,8,3], then the cost of some subarrays are:
· a3…a3:15−k⌈1/3⌉=15−10=5
· ...
题目题面Alice and Bob love playing one-dimensional battle ships. They play on the field in the form of a line consisting of n square cells (that is, on a 1 × n table).
At the beginning of the game Alice puts k ships on the field without telling their positions to Bob. Each ship looks as a 1 × a rectangle (that is, it occupies a sequence of a consecutive squares of the field). The ships cannot intersect and even touch each other.
After that Bob makes a sequence of “shots”. He names cells of the field ...







