Реляционная модель

The RISC Approach

RISC processors only use simple instructions that can be executed within one clock cycle. Thus, the "MULT" command described above could be divided into three separate commands: "LOAD," which moves data from the memory bank to a register, "PROD," which finds the product of two operands located within the registers, and "STORE," which moves data from a register to the memory banks. In order to perform the exact series of steps described in the CISC approach, a programmer would need to code four lines of assembly:

LOAD A, 2:3

LOAD B, 5:2

PROD A, B

STORE 2:3, A

At first, this may seem like a much less efficient way of completing the operation. Because there are more lines of code, more RAM is needed to store the assembly level instructions. The compiler must also perform more work to convert a high-level language statement into code of this form.

CISC RISC
Emphasis on hardware Emphasis on software
Includes multi-clock complex instructions Single-clock, reduced instruction only
Memory-to-memory: "LOAD" and "STORE" incorporated in instructions Register to register: "LOAD" and "STORE" are independent instructions
Small code sizes, high cycles per second Low cycles per second, large code sizes
Transistors used for storing complex instructions Spends more transistors on memory registers

However, the RISC strategy also brings some very important advantages. Because each instruction requires only one clock cycle to execute, the entire program will execute in approximately the same amount of time as the multi-cycle "MULT" command. These RISC "reduced instructions" require less transistors of hardware space than the complex instructions, leaving more room for general purpose registers. Because all of the instructions execute in a uniform amount of time (i.e. one clock), pipelining is possible.

Separating the "LOAD" and "STORE" instructions actually reduces the amount of work that the computer must perform. After a CISC-style "MULT" command is executed, the processor automatically erases the registers. If one of the operands needs to be used for another computation, the processor must re-load the data from the memory bank into a register. In RISC, the operand will remain in the register until another value is loaded in its place.

Модель данных:

- структура

- операции

- ограничение целостности

1-я была сетевая модель. Представление данных — граф.

Сейчас в основном использует реляционные и объектные модели.

Relation — отношение. В основе структуры реляционной модели данных лежит математическое отношение. Под словом Relation понимали — таблицу. Вся информация представлена в виде таблицы.

Опр. Доменом называется множество однотипных элементов. Например, множество целых чисел, множество строк, множесво названий цветов.

Опр. Атрибутом называется именованный домен.

R(A1, A2, …, An) Ai — атрибут

Di = dom(Ai) — атрибут Ai задан на домене Di

Опр. Схемой отношения называется конечное множество атрибутов.

D = D1 x D2 x D3 x … x Dn

r(R)∈D

Отношением r со схемой R принадлежит конечному подмножеству D. Каждый элемент отношения — кортеж. Отношение — множество кортежей.

r(R) = {t1, t2, t3, …, tm}

t = <d1, d2, d3, …, dn>

di ∈ Di

t(Ai) = di

Опр. Количество атрибутов называется степенью отношения.

Опр. Количество отношений в кортеже называется координальным числом.


Понравилась статья? Добавь ее в закладку (CTRL+D) и не забудь поделиться с друзьями:  



double arrow
Сейчас читают про: