Professional Documents
Culture Documents
1. Introduction
The idea of a universal computational device was first put forward by
Alan Turing in 1937. He proposed that all computations can be performed
by a special kind of a machine, now called a Turing machine.
The von Neumann model defines a computer as four subsystems:
memory, arithmetic logic unit, control unit, and input/output. The von
Neumann model states that the program must be stored in memory.
We can think of a computer as made up of three components: computer
hardware, data, and computer software.
The
history of computing and computers can be divided into three periods: th
e period of mechanical machines (before 1930), the period of electronic c
omputers (1930–1950), and the period that includes the
five modern computer generations.
With the invention of computers a new discipline has evolved, computer
science, which is now divided into several areas.
2. Number System
• Integers
An integer (an integral number with no fractional part) in the decimal
system is familiar
to all of us—we use integers in our daily life. In fact, we have used
them so much that they
are intuitive. We represent an integer as
The value is calculated as:
Reals
BINARRY
Hexa - Octal
Hexa
Octal
convert
Convert
Convert
Convert
Convert
Convert
3. Data Storage
• Data inside the computer
All data types are transformed into a uniform representation when
they are stored in a computer and transformed back to their original
form when retrieved. This universal representation is called a bit
pattern.
Storing integers
STORING TEXT
• Text is made up from M symbols, can be represented as M n-bit patterns, each pattern
defining a single symbol.
• Bảng mã ASCII : sử dụng 7 bít để biểu diễn 1 ký tự
• Bảng mã Extended ASCII: sử dụng 8 bít để biểu diễn 1 ký tự
• Bảng mã Unicode: sử dụng 32 bít để biểu diễn 1 ký tự
4. Operator on data
Shift operations
5. Computer Organization
6. Computer Networks
and Internet
7. Operating Systems
8. Algorithms
The cubes represent the algorithm
9. Programming language
10. Software Engineering
PROCEDURE ORIENTED OBJECT ORIENTED
• Biểu đồ luồng dữ liệu • Biểu đồ Usecase
• Biểu đồ thực thể liên kết • Biểu đồ Lớp
• Biểu đồ trạng thái • Biểu đồ trạng thái
PROCEDURE ORIENTED OBJECT ORIENTED
• Structure charts • classes with attributes and
methods
11. Data Structure
• A data structure uses a collection of related variables that can be
accessed individually or as a whole. In other words, a data structure
represents a set of data items that share a specifc relationship. We
discussed three data structures in this chapter: arrays, records, and
linked lists.
• An array is a sequenced collection of elements normally of the same
data type. We use indexes to refer to the elements of an array. In an
array we have two types of identifers: the name of the array and the
name of each individual element.
• Many applications require that data is stored in more than one
dimension. One common example is a table, which is an array that
consists of rows and columns Two-dimensional arrays can be stored in
memory using either row-major or column-major storage. The first is
more common
• The common operations on arrays as a structure are searching,
insertion, deletion, retrieval, and traversal. An array is a suitable
structure in applications where the number of deletions and insertions
is small but a lot of searching and retrieval operations are required. An
array is normally a static data structure and so is more suitable when
the number of data items is fixed.
• A record is a collection of related elements, possibly of different types,
having a single name. Each element in a record is called a field. A field
is the smallest element of named data that has meaning in a record.
• A string is a set of characters that is treated like an array in some
languages and as a type in others.
• A linked list is a collection of data in which each element contains the
location of the next element; that is, each element contains two parts:
data and link. The data part holds the useful information: the data to be
processed. The link is used to chain the data together.
• The same operations defined for an array can be applied to a linked
list. A linked list is a very efficient structure for data that will go
through many insertions and deletions.
• A linked list is a dynamic data structure in which the list can start with
no nodes and grow as new nodes are needed.
12. Abstract Data Types
• A stack is a restricted linear list in which all additions and deletions
are made at one end, called the top. If we inserted a series of data
items into a stack and then removed them, the order of the data is
reversed. This reversing attribute is why stacks are known as a last in,
first out (LIFO) structure. We defined four basic operations on a stack:
stack, push, pop, and empty
• A queue is a linear list in which data can only be inserted at one end, called the
rear, and deleted from the other end, called the front. These restrictions ensure
that data is processed through the queue in the order in which it is received. In
other words, a queue is a first in, first out (FIFO) structure. We defined four
basic operations for a queue: queue, enqueue, dequeue, and empty. A general
linear list is a list in which operations, such as insertion and deletion, can be
done anywhere in the list—at the beginning, in the middle, or at the end. We
defined six operations for a general linear list: list, insert, delete, retrieve,
traverse, and empty
• A tree consists of a finite set of elements, called nodes (or vertices), and a finite set of
directed lines, called arcs, that connect pairs of nodes. If the tree is not empty, one of the
nodes, called the root, has no incoming arcs. A binary tree is a tree in which no node can
have more than two subtrees. In other words, a node can have zero, one, or two
subtrees. A binary tree traversal requires that each node of the tree be processed once
and only once in a predetermined sequence. The two general approaches to the
traversal sequence are depth first and breadth first. A binary search tree (BST) is a binary
tree with one extra property: the key value of each node is greater than the key values of
all nodes in each left subtree and smaller than the value of all nodes in each right
subtree
• A graph is an ADT made up of a set of nodes, called vertices, and set
of lines connecting the vertices, called edges or arcs. Whereas a tree
defines a hierarchical structure in which a node can only have a single
parent, each node in a graph can have one or more parents. Graphs
may be either directed or undirected
13. Struct File
14. Data Base
• Definition: A database is a collection of related, logically coherent,
data used by the application programs in an organization.
operator
• Insert
• Update
• Delete
• Select
• Alter
14.5 DATABASE DESIGN
The frst step normally involves a lot of interviewing
of potential users of the database, to collect the
information needed to be stored and the access
requirements of each department.
• The literature divides the symmetric ciphers into two broad categories:
stream ciphers and block ciphers.
• Stream cipher: In a stream cipher, encryption and decryption are done one
symbol (such as a character or a bit) at a time. We have a plaintext stream, a
ciphertext stream, and a key stream. Call the plaintext stream P, the
ciphertext stream C, and the key stream K:
• And
• (e x d) mod ((p-1)*(q-1)) = 1
Ví dụ: Xác định cặp khóa (e,n), (d,n) bằng
giải thuật RSA
• Giả sử: Chọn p =3, q = 5
• Ta có n = 3x5 =15
• Q = (3-1) x(5-1) = 8
• Chọn e và d sao cho e * d mod 8 = 1
ÞTa có e * d = k * 8 +1
ÞCác cặp e, d ta có thể chọn:
Þe =9, d =1 Hoặc e =1, d=9 vì 1 x9 mod 8 = 9 mod 8 =1
ÞHoặc e = 3, d =11 hoặc e =11, d=3 vì 3 x 11 mod 8 =33 mod 8 =1
Þ……