Analogue vs. Discrete data

Size: px
Start display at page:

Download "Analogue vs. Discrete data"

Transcription

1 CL 1 Analogue vs. Discrete data analogue data Analogue vs. Discrete data Data is the raw information that is input into the computer. In other words, data is information that is not yet processed by the CPU. It can be provided in several forms, such as text, spoken words, diagrams, numbers, music, pictures and others. When data is input into the computer, it is changed into an electrical signal, which can be represented in two ways: analogue or digital. Analogue data is data that varies continuously and smoothly. It can have any value within a specified range. When analogue data is input into the computer, it is changed into a voltage or current (electric signal) that varies smoothly within a range of values. Sound is an of analogue data. When recorded to a computer, through a microphone, it is changed into Voltage in an analogue format. Examples of analogue values, when the range is between 0 and 5 may include 0.23, 4.32, 1.65, 5, 3.9, etc. digital data Although data input into the computer can be either digital or analogue, the digital computer can only understand digital data, so all data must be changed to digital after being input into the computer. This is done by the analogue to digital converter (ADC) explained overleaf (see CL2). Digital data is represented electronically through electrical pulses. Contrary to analogue signals, digital signals use only two discrete voltages, which typically in digital computers are 3V (low voltage) and 5V (high voltage). The discrete voltages are represented as 0 and 1, 0 representing a low voltage (i.e no pulse), while 1 represents a high voltage (i.e. a pulse). When being transmitted from one device to another, the voltage may vary a little. When this happens the computer will consider it as the voltage that it is closer to ( 4.1 will be as 5V, while 0.43 is considered to be 0V). Example of an analogue signal Example of a digital/discrete signal 1

2 CL 2 Analogue vs. Discrete data analogue-to-digital converters As already stated before, all analogue data input into a digital computer has to be converted to digital data, in order for the computer to be able to process it. The process of converting data signals from analogue to digital is carried out by an analogue-to-digital converter (ADC), and is called digitising or sampling. An is when you record sound on your computer. The sound you record is converted to digital form by an analogue-to-digital converter and stored in the hard disk as 0s and 1s. digital-to-analogue converters The digital-to-analogue converter (DAC) converts digital signals to analogue, and is used when data is being retrieved from the computer and sent to an analogue device. For, when playing an mp3 the computer must first convert the file to analogue so that the speakers will then be able to output the sound in a form we are able to understand. Later, when you want to hear the sound, it is retrieved from the hard disk, converted back to analogue form by the digital-to-analogue converter, and sent to the speakers. 2

3 CL 3 Analogue vs. Discrete data two-state devices Digital computers are made up of electronic circuits comprising of logic gates (see CL19). At their most basic level, digital computers can only determine whether a logic gate is open and therefore a signal is passing through, or whether it is closed therefore no signal is passing through. This means that computers can only recognize two states: on or off. For this reason we consider the computer to be a two-state device. Two-state devices can therefore be compared to a switch which can be either on or off. On and off states are referred to in different ways, some s including: on off 1 0 true false storing data in a computer Since digital computers recognise only 1s and 0s, all data input into the computer must be converted into binary that is in a series of 0s and 1s, in order to be stored. units of storage Since computers can only understand 0s and 1s any data we input into computer must be converted into 0s and 1s to store in any storage device. We calculate how large a file is by taking into account the number of bits (binary digits - see CL4). The more bits a file has the larger it is. The following is a list of units for storing data: units for storing data 1 byte 8 bits 1 kilobyte (KB) 1024 bytes 1024 x 8 bits 2 10 bytes 1 megabyte (MB) 1024 KB 1024 x 1024 bytes 2 20 bytes 1 gigabyte (GB) 1024 MB 1024 x 1024 x 1024 bytes 2 30 bytes 1 terabyte (TB) 1024 GB 1024 x 1024 x 1024 x 1024 bytes 2 40 bytes 3

4 Analogue vs. Discrete data Analogue data Summary 1 ❶ Data that varies continuously and smoothly within a range of values. ❷ Sound is an of analogue data. ❸ If range is between 0 and 5 then values may include 0, 0.23, 4.32, 4, 1.65, 5, 3.9, etc Digital data ❶ Digital data consists of only two values 0 and 1 which in computers are represent 0V and 5V respectively. ❸ 5V or binary 1 signifies an on signal, while 0V signifies an off signal and is represented by binary 0. Converting signal format Analogue-to-Digital Converter (ADC): Converts analogue signals to digital. Digital-to-Analogue Converter (ADC): Converts digital signals to analogue. Two-state devices Computers are called two- state devices because they can only understand two states, which are on and off. Units of storage 1 byte 8 bits 1 Kilobyte (KB) 1024 bytes 1 Megabyte (MB) 1024 x 1024 bytes 1 Gigabyte (GB) 1024 x 1024 x 1024 bytes 1 Terabyte (TB) 1024 x 1024 x 1024 x 1024 bytes 4

5 CL 4 Number Systems Number Systems decimal numbers In everyday life, we use the decimal system, which has ten digits (0-9), thus we can say that it has a base of 10. We combine these digits to form larger numbers. We use this number system because we have ten fingers. However, the decimal system is not the only number system that exists. Imagine an alien specie with 8 fingers. It would be much easier for them to use a number system with eight digits. binary numbers 1 0 Although computers do not have two fingers, they can only recognise two states, as we have already explained before (see CL4). For this reason, the number system used by digital computers is the binary system. In the same way that the decimal system has ten digits, the binary system has two digits, which are 0 and All letters, numbers and special characters are changed into binary 1s and 0s before they are stored or processed by the computer system. This is possible by combining 0s and 1s to represent larger numbers as we will see further on. Some s of binary numbers labeling numbers Every number should be followed by the base number as a subscript, otherwise there will be no way for the reader to know what number system you are using. Numbers in binary have a subscript 2, : Numbers in decimal have a subscript 10, :

6 CL 5 Number Systems representing decimal numbers Every number in base ten can be described in terms of units (1), tens (10), hundreds (100) and thousands (1000). These are known as weights. Therefore the weights of each column heading is found from base n-1 where base in this case is 10 and n is the number of the column. Note that the smallest weight, i.e. unit is always the rightmost digit. The number can be described as: Thousands Hundreds Tens Units digit 4 digit 3 digit 2 digit 1 thousands hundreds tens units In this case, 3 is called the Most Significant Digit (MSD), since it is the one that has the biggest weight, while 8 is the Least Significant Digit (LSD) because it has the smallest weight. representing binary numbers The same method can be applied to binary numbers, so the binary weights are calculated using 2 n-1, since the base of the binary number system is 2. The number consists of: bit 4 bit 3 bit 2 bit MSB LSB A binary digit is called bit in short, so in this case 0 is the Most Significant Bit (MSB), since it is the one that has the biggest weight, while 1 is the Least Significant Bit (LSB) because it has the smallest weight. As you can see in the above, the LSB has a weight of 2 1-1, that is 2 0. Note that 2 0 is 1 and not 0. 6

7 CL 6 Number Systems converting binary numbers to decimal To convert a binary number to decimal, you need to follow the steps explained below. STEP 1 Convert to decimal Place each digit under its respective weight. The weights are the green numbers in the first row STEP 2 0 x 1 = 0 0 x 2 = 0 1 x 4 = 4 1 x 8 = 8 Multiply each digit by its respective weight. STEP 3 Add the above multiplication answers in order to obtain the decimal equivalent of Answer: = = 12 converting decimal numbers to binary To convert a decimal number to binary, divide the number by 2 until the dividend (integer part of division answer) becomes 0. Then, read all the remainders starting from the last. Convert to binary STEP 1 Divide the number by 2 until the dividend becomes = 5 r = 2 r = 1 r = 0 r 1 MSB LSB STEP 2 Start writing the remainders of the division, starting from the MSB (last remainder) and place them next to each other starting from the left hand side to form the binary number Answer: =

8 CL 7 Number Systems registers Registers are temporary storage locations that store data. Registers are divided into a number of storage spaces, each of which can only contain one binary digit. For, an 8-bit register is a register that has eight storage spaces, and therefore it can only store 8 bits (1s and 0s). On the other hand, a register containing 16 storage spaces is called a 16-bit register and it can store 16 bits. We can compare a register to a number of switches next to each other, each of which can either be either on (1) or off (0). This is an of an 8-bit register containing the binary value of Store the decimal number in an 8-bit register STEP 1 First of all, we need to convert into binary, since data in registers is stored in binary = 22 r = 11 r = 5 r = 2 r = 1 r = 0 r = MSB LSB STEP 2 Now write the answer obtained above in the register, placing the right-most digit under the LSB. MSB LSB STEP 3 Fill in the empty spaces in the register using 0s, since anything multiplied by 0 will remain 0. MSB LSB 8

9 CL 8 Number Systems ranges Each storage space in a register can store either a 0 or 1, therefore a number of different binary numbers can be stored. Since the register is of a fixed size, there is a limit as to which numbers can be stored. Let s start by considering an 8-bit register as an. Let us consider an 8-bit register. Smallest possible number The smallest number that can be stored in any register is when all the storage spaces are If we convert this number into decimal, we get decimal number Largest possible number On the other hand, the biggest number that can be stored is when all storage spaces contain a Let s convert this number into decimal: x 1 = 1 1 x 2 = 2 1 x 4 = 4 1 x 8 = 8 1 x 16 = 16 1 x 32 = 32 1 x 64 = 64 1 x 128 = 128 Adding these values together we will get the decimal number Range Therefore, the range of decimal numbers that can be stored in an 8-bit register is from 0 10 to

10 CL 9 Number Systems It is easy finding the range of an 8-bit register by converting the binary numbers into decimal. Imagine you want to find out the range of numbers that a 32-bit register can store. That would be quite complicated to work out in this way. Let us then obtain the general rule for finding out the range of a register of any size. From the previous, the largest number that could be represented in an 8-bit register, was However, 2 8 results in 256. As you can observe, the biggest number that can be stored in an 8-bit register is 255 (i.e ). Therefore, as a general rule we can say that the biggest number a register can store is 2 n -1 where n is the number of bits the register can hold. Therefore the range of a register is: [0, 2 n -1] calculating the range of possible numbers No matter how many bits the register can hold, all you need to do to find the largest number that can be represented is to use 2 n -1. The range is then from 0 to that number. [0, 2 n -1] binary addition Addition in binary is very similar to addition in decimal. However, the difference is that whereas in decimal we carry 1 when the result of the addition of two integers was 10 10, in binary we need to carry 1 when the result of the binary addition is 10 2, i.e addition 0 + 0= = = =10 (the 1 is carried) Add and carry Numerical overflow Similar to decimal addition, we start adding from the LSB. As you can see the end result consists of 9 digits instead of 8. When the number is too large to fit in the register it is said that a numerical overflow has happened. We always ignore numerical overflows since there is not enough space to store it in the register. 10

11 CL 10 Number Systems binary subtraction The computer circuitry can only perform additions. There is no circuit in the ALU that can specifically subtract two numbers. In order to perform a subtraction, the computer must first complement the second number, i.e. change it to negative. Then the subtraction would be performed as an addition problem in the form of a + (-b), where a is the first number and b the second number. two s complement Two s complement is one way in which to convert positive numbers into negative, and vice versa. First, we need to know whether the number to be converted is positive or negative. The most significant bit of a register now states whether the number is positive or negative. This is because the binary weights used are all positive numbers (1, 2, 4, 8, etc ), except the weight for the most significant bit which is now negative (eg. In an 8-bit register the MSB will be -128). Therefore, when the MSB is 1 it means that the number is negative, while when the MSB is 0 it shows that the number is positive. changing a positive number to negative To find the two s complement of a binary number you need to change all 1s to 0s and all 0s to 1s, and then add 1 to your result. STEP 1 Find the two s complement of Change all 1s to 0s and all 0s to 1s STEP 2 Add 1 to this number Answer: Check answer To check that your answer is correct convert the two numbers to decimal

12 CL 11 Number Systems two s complement of 0 Note that the two s complement of 0 will still be 0, which makes sense since 0 does not have a sign. However, if you try to perform two s complement on 0 you will find out that after changing all 0s to 1s and adding 1 you will change the 1s back to 0. subtraction As we already mentioned before, binary subtraction is performed by changing the second number to negative and then adding the two numbers. Let s work out an. Work out using a 4-bit register STEP 1 First we need to convert 5 and 3 to binary. 5 2 = 2 r = 1 r = = 1 r = = 0 r = 0 r 1 STEP 2 STEP 3 Place these numbers in registers (its size depending on the biggest number) and fill in the empty spaces with 0s. Convert i.e into negative using two s complement Add the two numbers, i.e and STEP 4 Since the MSB is 0 (we ignore the numerical overflow) the answer is a positive number. The answer in this case is

13 CL 12 Number Systems multiplication and division Computers can also perform multiplication and division. This however is not done in the same way as we do it in mathematics, but by shifting register content to the left or to the right. Multiplication is performed by shifting the contents of a register to the left, while division is obtained by shifting the contents to the right. Shifting the contents one position will result in a multiplication or division by 2, while shifting the contents by two positions will result in a multiplication or division by 4, and so on. Thus every position divides or multiplies the value by 2. shift to the left Shift to the left STEP 1 STEP 2 Shift the contents of the register 1 place to the left. Ignore the bit that is now out of the register and fill in the empty space in the register with a 0. MSB LSB shift to the right Shift to the right STEP 1 STEP 2 Shift the contents of the register 1 place to the right. Same as above, the bit out of the register is ignored, and a 0 is placed in the empty space MSB LSB

14 CL 13 Number Systems hexadecimal numbers Binary numbers can be very long, so we use hexadecimal numbers as a shortcut. Hexadecimal is yet another number system and it has a number base of 16, which means that it consists of 16 digits (0-15). Since digits 10 to 15 consists of two digits, letters are used to represent them as follows A B C D E F A = 10 B = 11 C = 12 D = 13 E = 14 F = 15 converting hexadecimal numbers to binary Convert D5 16 to binary A hexadecimal number is converted into binary by converting each hexadecimal digit into binary. Each hexadecimal digit is converted into a 4-bit binary number. D 16 = = 6 r = 3 r = 1 r = 0 r 1 MSB LSB D = 2 r = 1 r = 0 r = MSB LSB D 16 = Answer: D5 16 = converting binary numbers to hexadecimal Starting from the right-hand side (i.e. the least significant bit), split the binary number into groups of four bits. Convert each group as if you re converting into decimal. Combine these numbers to form the hexadecimal number. Convert to hexadecimal Answer: =

15 Number Systems Summary 2 Binary numbers Base: 2 Digits: 0, 1 Weights calculated by: 2 n-1 Decimal numbers Base: 10 Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Weights calculated by: 10 n-1 Weights Weights are calculated using base n-1 where n is the number of the digits (start counting from the right). This is an of binary weights. The LSB (Least Significant Bit) always carries a weight of 1 because n 1-1 = n 0 which is always 1. bit 4 bit 3 bit 2 bit MSB LSB Converting binary to decimal To convert a binary number to decimal you need to: ❶ Multiply each digit by its weight. ❷ Add the answers you obtained from step 1. Converting decimal to binary To convert a decimal number to binary you need to: ❶ Divide the number by 2 until dividend is 0. ❷ Write all remainders starting from the last. See CL6 for See CL6 for Converting binary to hexadecimal To convert a binary number to decimal you need to: ❶ Divide the number in groups of 4 bits each. ❷ Convert each group into a digit. Converting hexadecimal to binary To convert a binary number to decimal you need to: ❶ Convert each digit into binary. ❷ Represent each digit using 4 bits. See CL13 for See CL13 for 15

16 Number Systems Summary 2 Registers ❶ They are temporary storage locations. ❷ They are divided in a number of storage spaces. ❸ The size of the register is determined by the number of storage spaces it consists of. ❹ Each storage space can contain only one 0 or 1, like a switch that can be either on or off. Ranges ❶ The smallest possible number that can be stored by a register of any size is 0 (all storage spaces contain a 0). ❷ The largest possible number depends on the size of the register, and it is calculated using 2 n -1, where n is the size of the register. Two s complement To change a positive number to negative using two s complement you need to: ❶ Change all 0s to 1s and all 1s to 0s. ❷ Add 1. Shift binary numbers to the left This will divide the number by 2 for each position you shift it. ❶ Shift contents of register to the left. ❷ Ignore leftmost bits. ❸ Insert a 0 in each empty storage space. Shift binary numbers to the right This will multiply the number by 2 for each position you shift it. ❶ Shift contents of register to the right. ❷ Ignore rightmost bits. ❸ Insert a 0 in each empty storage space. 16

17 CL 14 Coding Systems Coding Systems representing text As we already said before, all data input into the computer must be converted into binary. Therefore, text and special characters as well as numbers have to be converted into binary. Obviously text and characters cannot be converted to binary in the same way as numbers are, but each character is assigned a binary code. These codes have to be agreed on by everyone, otherwise a character that is displayed correctly on one computer may not be displayed in the same way on another computer. The range of characters that can be represented using a coding system depends on the number of bits that the coding system allocates. For if the coding system allocates using 7 bits, the maximum number of characters that can be represented is 2 n -1 (see CL9), which in this case is 2 7-1, i.e. 127 characters can be represented. ASCII code The ASCII (American Standard Code for Information Interchange) is an international standard which changes all characters into a numerical code, which is then converted to binary and stored or processed by the computer. ASCII uses 7 bits to represent each character, therefore as we calculated above, the maximum number of characters that it can represent are 127. Below you can see the codes representing the characters by the ASCII code. ASCII code table Codes 0 to 31 are used to represent control keys such as Backspace, Tab and Escape. 17

18 CL 15 Coding Systems extended ASCII code The 7-bit ASCII code system was suitable enough when few computers were used in industries. However, it was not suitable enough to represent all needed characters when the personal computer was introduced in 1981, since computers were then being used in other countries apart from America and England. The older ASCII code system could not represent foreign characters, such as æ, ê, ñ and ç. For this reason, IBM started using an 8-bit ASCII code, which meant that now 255 characters could be represented. The extra 128 characters included foreign letters and special characters that could be used for drawing. Every printer had its version of extended ASCII characters, but eventually the Epson version became the most popular. Below you may find an. ASCII code table the problem of transferring data Although the extended version of the ASCII coding system could contain more characters, it was still not enough to contain all possible characters. For, to insert Maltese characters, such as ċ, ġ, ħ, and ż, we had to replace temporarily an existing character, such as the curly brackets, {. However, this only worked if the document was seen on the author s computer. If it was sent to another computer, which did not have the same modifications, these special characters would not be displayed, but the real characters in the ASCII table would be displayed instead. For, if one replaced the { by the ġ, then on the receiving computer the { would be displayed where the user had inserted ġ in the document. 18

19 CL 16 Coding Systems UNICODE As a result of this problem, another coding system had to be developed. This system had to include all different characters necessary, including special characters for each language, musical symbols, mathematical symbols, and so on. Each character had to have one code no matter what platform, program or language is being used, so that when transferring data and documents from one computer to another the document is still readable and the special characters the author uses are the same on the receiving computer, as they are on the transmitting computer. Several versions of UNICODE have been developed, each containing more available characters that the computer users all over the world can make use of. UNICODE in use If you are using Office XP or 2003, you are making use of the UNICODE coding system for your characters. By choosing Symbol from the Insert menu you can find a whole table of UNICODE characters which you are allowed to insert into your document and no matter to whom you send it, the document on the receiving computer will remain intact. representing characters in mainframe computers So far, we have considered the coding systems used by what we know today as personal computers. However, there were also mainframe computers, which were also referred to as the big iron. Mainframe computers were very powerful, large and expensive computers which could support thousands of users online at the same time. They were used mainly for bulk data processing and financial transaction processes. Honeywell-Bull DPS 7 mainframe 19

20 CL 17 Coding Systems EBCDIC The BCDIC (Binary Coded Decimal Interchange Code) was used for non-ibm mainframe computers, between the 1950s and 1970s. This system used a 6-bit BCD coding system and mainly consisted of characters and especially control codes, due to the jobs performed by mainframe computers. The EBCDIC (Extended Binary Coded Decimal Interchange Code) is the extended version of the BCDIC and was used by IBM mainframe computers. This coding system, like the extended version of ASCII, used an 8-bit coding system, which although it could contain the same amount of characters as the extended ASCII coding system, differed from it because rather than containing special letters and such, the EBCDIC contained more control codes. binary coded decimal (BCD) In the previous section we have seen how numbers are represented in binary. However, there is another way to represent numbers in binary, which is the BCD (Binary Coded Decimal). In BCD digits are converted separately to binary by assigning each digit 4 bits. Convert to BCD = 1 r = 0 r = 2 r = 1 r = 0 r 1 Convert each single digit separately, using the same system used to covert decimal numbers into binary. Assign 4 bits for each digit The BCD for = Convert the BCD number to decimal Divide the BCD number into groups of 4 bits and convert each group into decimal. 1 6 Answer:

21 Coding Systems Representing text Summary 3 ❶ All data input into the computer must be changed to binary, including numbers, text and special characters. ❷ A coding system is used to represent data. ❸ Characters are changed into a numerical code which is then converted to binary. ❹ Coding systems have to be agreed on by everyone so that all data is represented in the same way on all computers. ASCII ❶ American Standard Code for Information Interchange. ❷ It uses 7 bits to represent each character. ❸ The number of characters that can be represented is 2 n -1, i.e , i.e. 127 characters. Extended ASCII ❶ Developed because ASCII was not enough to represent all characters when computers started being used outside America and England. ❷ Uses 8 bits to represent characters, i.e , i.e. 255, which means that it could represent an extra 128 characters. Problem Data could be displayed incorrectly when sending it on different computers. Unicode ❶ Unicode could store much more characters. ❷ Different versions of Unicode exist, each using a different number of bits to represent data. ❸ Two versions of Unicode use 16 bits and 32 bits respectively to represent characters. EBCDIC ❶ Used by mainframe computers. ❷ Uses an 8-bit coding system. ❸ EBCDIC represents more control keys than characters. 21

22 CL 18 Logic Circuits Logic Gates what are logic gates? Computers are called two-state devices (see CL4) because the circuits that make up the computer system, consist of a number of logic gates that can only accept 0s and 1s as inputs or outputs. Logic gates are very small electronic, decision-making devices that are fed inputs and give back an output. They are called gates, because they can virtually open to allow a signal to pass through (1), or close so that no signal passes through (0). The inputs and outputs to and from logic gates can, therefore only be 0s or 1s. Although the number of inputs that can be accepted vary according to the type of logic gate, all logic gates can only give one output. Logic gates are combined together to create the circuits that make up the computer system. When combined, logic gates can achieve any needed output from the set of possible inputs. the three basic logic gates Although more logic gates exist, the three basic logic gates are the NOT, AND and OR gates. As we will see further on, these three logic gates can be used together to produce any necessary output. However, for now let us find out what each logic gate does. NOT gate As you can see from the symbol, the NOT gate accepts only one input, and it gives one output in return. In fact, the NOT gate is the only gate that accepts only one input. Symbol The output the NOT gate gives is the reverse of the input. Therefore if the input is 0, the output is 1 and if the input is 1 the output is 0. For this reason, the NOT gate is also known as the inverter. Truth table Input Output The NOT gate can be represented using three different notations, which are: NOT, ~ or. Therefore we can say that: B = NOT A B = ~A B = A A B

23 CL 19 Logic Circuits AND gate The AND gate can accept two or more inputs, but gives only one output. The output is always 0, except when all inputs are 1. Symbol This means that a signal is only allowed to pass through the gate when a signal is coming into the gate from all inputs. Truth table Inputs Output A B C The AND gate can also be represented using three different notations, which are: AND,. or. Therefore we can say that: C = A AND B C = A. B C = A B OR gate Like the AND gate, the OR gate can accept two or more inputs, and gives one output. Symbol The OR gate allows a signal to pass through when a signal is coming in from any or all the inputs. Therefore, we can say that the OR gate gives 1 as an output when any one or more inputs are 1. Like the other two logic gates, there are three different notations for the OR gate, which are: OR, + or. Therefore we can say that: C = A OR B C = A + B C = A B Truth table Inputs Output A B C truth tables Each logic gate has a set of possible input combinations that can enter the logic gate at one instance, and the output produced by the logic gate depends on them. The set of all possible inputs together with the output they would produce by that particular logic gate are recorded in what is called a truth table. The purpose of these truth tables is to make it possible to predetermine what the output of the logic gate or circuit is going to be for the possible inputs at each point along the logic circuit. Inputs Output A B C

24 CL 20 Logic Circuits what are the possible inputs to a logic gate? The NOT gate accepts a single input, so it can only accept either one of the two possible inputs, i.e. 0 or 1. However, AND and OR gates can accept two inputs, so a 1 or 0 can be accepted from the two inputs at the same time. This means that at one instance: both inputs can be 0 input A can be 0 while input B is 1 input A is 1 while input B is 0, or both inputs can be 1 Therefore, there are four possible input combinations. We can calculate the number of possible inputs by using 2 n, where n is the number of inputs to a particular gate. When the logic gate accepts three inputs, using 2 n we find out that there are 8 possible input combinations. building the truth table The first thing we need to consider when building a truth table is which are the inputs that are being fed into the logic gate, and how many inputs are there. Using the formula 2 n we can then find out how many input combinations are possible, and fill in the truth table accordingly. Inputs Output A B C D 0 0 This logic gate has three inputs A, B and C. Therefore 2 3 = 8, so there are 8 possible input combinations for this logic gate. Let s first fill in the truth table by dividing the 1s and 0s into the three rows for the inputs Column A: 8 2 = 4 (8 is the number of all possible input combinations) In column A insert 4 0s followed by 4 1s. Column B: 4 2 = 2 (4 is the answer of 8 2) In column B insert 2 0s followed by 2 1s twice. continued 24

25 CL 21 Logic Circuits continued Inputs Output A B C D Finally, Column C: 2 2 = 1 Insert a 0 followed by a 1 until all columns are filled in Now that we have filled in all the possible input combinations, we now have to fill in the column for the output. The logic gate in this is an AND gate, which gives us a 1 only when all inputs are 1, and a 0 when at least one of the inputs is 0. Therefore if we start filling in the truth table all outputs are 0 except that for the last input combination, i.e. 1, 1 and 1 give us 1. steps for building a truth table 1. Which are the inputs to the logic gate? 2. How many inputs does the logic gate have? (i.e. n) 3. What is the number of possible input combinations? (i.e. 2 n ) 4. Fill in the columns for the inputs according to the number of possible input combinations. 5. Fill in the output column according to which logic gate is used. boolean/logical expressions Boolean/logical expressions are used to describe the logical state of the logic gates or circuits. In other words, the operations performed by these logic gates are represented by Boolean/logical expressions. These expressions result in a Boolean value, i.e. a true (1) or a false (0). All expressions are made up of operands and operators. The operators of Boolean logic are AND, OR and NOT, while the operands are the inputs to the logic gates. did you know? The Boolean expression for this logic gate is C = A OR B. George Boole ( ) developed Boolean algebra, which is why it is named after him. 25

26 CL 22 Logic Circuits the three Boolean/logical operators The three operators AND, OR and NOT can be represented in different ways. Logic gate symbol Word representation Symbolic representation B = NOT A A A / ~ A C = A AND B A. B A B C = A OR B A + B A B what is a logic circuit? Logic Circuits Using single logic gates will not give us much different outputs, so logic gates are combined together into logic circuits to produce the necessary outputs. Logic circuits are therefore a combination of logic gates that accept a number of inputs and give one output. An of a logic circuit is the following circuit implemented using the AND and NOT gates as follows. This circuit is made up of two logic gates. The inputs of the circuit are A and B and are being fed into the first logic gate, AND. The output of this logic gate, C is therefore A AND B. This output is then fed as input into the next logic gate, NOT. The output of the NOT gate is also the output of the whole circuit, and is NOT C. Since C = (A AND B), and D = NOT (C), we can say that D = NOT (A AND B). Inputs Output A B C D

27 CL 23 Logic Circuits what are logic circuits used for? Logic circuits are used in many electronic devices with embedded computers, which we use in our every-day life. Some s of devices we use regularly which have embedded logic circuits include: Computers Calculators Washing machines Microwave ovens Digital watches Air conditioners Cars Sandwich toasters, etc... An of a logic circuit used in an electronic equipment that we use daily in our lives is the open door sensor in cars. The LED on the car dashboard will turn on when either one or more doors are open. Therefore, all car doors are connected to OR gates, which identify whether at least one of the doors is open. If at least one door is open then the LED on the dashboard is turned on. parallel ports If you look at the back of your computer tower, you will see a couple of parallel ports. What are these parallel ports? Parallel ports are connection points that the computer uses to send and receive a lot of data to and from an input/output device over a short distance. They are mostly used to connect printers to the system unit, although the USB port is nowadays taking over. Parallel ports are a set of AND logic gates, placed in parallel, where every set of AND gates is responsible for a certain function. 27

28 CL 24 Logic Circuits determining unlabelled logic gates in a circuit An unlabelled logic gate can be either one of the three basic logic gates: AND, OR and NOT. It is easy to realise when the unlabelled gate is a NOT gate, since the NOT gate is the only gate that accepts only one input. If the unlabelled logic gate has two or more inputs, then determining whether it is an AND or an OR gate can be done by referring to the truth table. Given the output that the gate will produce for the possible inputs will let us know what logic gate it must be. Let s consider an. The following circuit has an unlabelled logic gate. Let s find out what type of logic gate it is. X The truth table for this circuit is as follows. Inputs Output A B C D E The output of the unlabelled gate, is E and its inputs are C and D. Therefore we need to consider these three columns in the truth table. As we can see, gate X will give us a 1 when the inputs are either both 1 or when at least one of them is 1. Therefore it must be an OR gate, since the AND gate gives us a 1 only when both inputs are 1, while the OR gate gives us a 1 when either one or both of the inputs are 1. Answer: The unlabelled logic gate X is an OR gate. 28

29 CL 25 Logic Circuits determine boolean expression from circuit Starting from the right hand side build a tree with the operators and inputs you meet. When you finish the process you will end up with a tree of operators and operands. After, you will need to read the tree to determine the Boolean expression. Let s determine the Boolean expression for this circuit. Starting from E we will traverse the logic circuit to find that the first logical operator is an OR. This is therefore placed as the root of our tree. OR The first input to this logic gate is C, which is coming as an output from another OR gate, therefore on the left-hand side of OR in our tree we shall place another OR. OR OR On the right-hand side we need to place the second input to the first OR gate. In this case D traces back to B, therefore we shall place B on the right-hand side of OR. OR OR B We will now trace the inputs of the second OR gate, and find out that both inputs to this gate are inputs to the circuit, A and B, therefore we shall place A on the right-hand side of OR and B on the left-hand side. Our tree is now ready and needs to be converted into a Boolean expression. OR OR B A B OR OR B We need to follow the three steps: 1. Read left node 2. Read root 3. Read right node A B Therefore starting from A we will obtain the expression: E = (A OR B) OR B 29

30 CL 26 Logic Circuits We have already discovered that the NOT gate has only one input, therefore this means that when building the tree we only have to place one input, which we will always place at the righthand side of the NOT. Let s see an. Let s establish the Boolean expression for this circuit now. So, starting from D, the first logic gate that we meet is the NOT gate, therefore we set it as the root of our tree. NOT The input to this logic gate is C, which is the output of an OR gate, so we place OR to the right hand side of NOT. The inputs to the OR gate are the inputs to the circuit, A and B, which we place on the right and left of OR. NOT OR NOT OR A B NOT A OR B Now, following the same three steps we had to follow in the before, we will find out that we have nothing on the left-hand side of our tree, so we go back to the root which is NOT. Then we will go to the right and read the sub tree which according to those three steps will give us (A OR B). Therefore we end up with the logical expression D = NOT (A OR B) reading sub trees When building a tree we can only write the logic gate and the outputs to the whole circuit. When reading a sub tree it is important that we enclose the sub expressions in brackets, so that when we form the whole expression it is still correct. Considering the above, if we wrote D = NOT A OR B instead of D = NOT (A OR B), it would have meant that only input A is input into the NOT gate, which as you can see from the circuit is not true. 30

31 CL 27 Logic Circuits determine boolean expression from truth table Now that we have seen how to determine the Boolean expression from the circuit, let us now find out how to determine the Boolean expression when you are only given the truth table. We need to: 1. Consider the row/s where the output is 1 2. Look at the inputs of that row. Where the input is 1 take the input, and where the input is 0 take the NOT of that input. Eg if A is 0 then take NOT A. 3. Add the inputs on the same row by using AND. 4. If there are more than one row, combine all sub expressions using OR. Let s work out two s so that you will understand better how to apply these steps. Let s determine the Boolean expression for this truth table. A B C First we need to consider the rows where the output is 1, which in this case is only one row, i.e. the second row. A B C As you can see the inputs in this row are 0 and 1. A is 0, while B is 1. Therefore we need to not A. So for the output to be 1, A must be 0, i.e. A and B must be 1, i.e. B. Now we need to add these inputs using an AND since both conditions must be true for the output to be 1. So we have A AND B. Since we only have one row, then our logical expression is: C = A AND B 31

32 CL 28 Logic Circuits Let s now try to determine the Boolean expression for this truth table. A B C In this there are two rows where the output is 1, which are the second and the fourth rows. A B C The inputs in the first row are the same as those in the previous, i.e. A and B: A AND B The inputs for the second row are both 1, therefore A and B: A AND B In this we have two rows, therefore we need to combine the two sub expressions above using an OR gate, since for the logic circuit to output a 1, either A AND B or A AND B need to be true. Therefore our expression is: C = (A AND B) OR (A AND B) drawing the circuit from the boolean expression Given the Boolean expression you can then draw the circuit. To draw the circuit you need to start by drawing the sub-expressions, i.e. the expressions derived from each row of the truth table. After drawing these sub-expressions, you will need to connect all outputs of these sub-circuits using OR gates. Let s look at an so you can understand better. drawing the circuit from the boolean expression To draw a circuit: 1. First draw the separate sub-expressions 2. Then connect their outputs using OR gates. 32

33 CL 29 Logic Circuits Draw the logic circuit for C = (A AND B) OR (A AND B) C = (A AND B) OR (A AND B) First we need to draw the two sub-expressions, i.e. (NOT(A) AND B) and (A AND B). NOT (A) AND B A AND B Now that we have drawn the two sub-expressions, we need to connect the outputs of these two AND gates by using the OR gate, since that is the operator used to connect these two sub-expressions in the Boolean expression. The circuit is now ready. You can test this circuit on MMLogic to check whether it produces the wanted output. drawing the logic circuit from the truth table From what we have learnt above, we can conclude that we can draw the logic circuit when given the truth tables in two major steps: 1. Determine the Boolean expression from the truth table. 2. Draw the circuit from the Boolean expression. 33

34 Coding Systems Summary 4 Logic gates ❶ They are small electronic, decision-making devices that are fed inputs and give back an output. ❷ Logic gates may accept two or more inputs, except the NOT gate which can accept only one output. ❸ All logic gates can give only one output, which can be either true (1) or false (0). ❹ The three basic logic gates are AND, OR and NOT. AND OR NOT Inputs Output A B C Inputs Output A B C Input Output A B Boolean expressions ❶ An expression used to describe the logical state of logic circuits. ❷ Boolean operators include AND, OR and NOT. ❸ Results of Boolean expressions are either true or false, i.e. 1 or 0 respectively. Did you know that the British mathematician George Boole ( ) developed Boolean Algebra? That is why it is now named after him. 34

The type of all data used in a C++ program must be specified

The type of all data used in a C++ program must be specified The type of all data used in a C++ program must be specified A data type is a description of the data being represented That is, a set of possible values and a set of operations on those values There are

More information

Using sticks to count was a great idea for its time. And using symbols instead of real sticks was much better.

Using sticks to count was a great idea for its time. And using symbols instead of real sticks was much better. 2- Numbering Systems Tutorial 2-1 What is it? There are many ways to represent the same numeric value. Long ago, humans used sticks to count, and later learned how to draw pictures of sticks in the ground

More information

Module 1: Information Representation I -- Number Systems

Module 1: Information Representation I -- Number Systems Unit 1: Computer Systems, pages 1 of 7 - Department of Computer and Mathematical Sciences CS 1305 Intro to Computer Technology 1 Module 1: Information Representation I -- Number Systems Objectives: Learn

More information

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer. Digital Logic 1 Data Representations 1.1 The Binary System The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer. The system we

More information

The type of all data used in a C (or C++) program must be specified

The type of all data used in a C (or C++) program must be specified The type of all data used in a C (or C++) program must be specified A data type is a description of the data being represented That is, a set of possible values and a set of operations on those values

More information

Module 2: Computer Arithmetic

Module 2: Computer Arithmetic Module 2: Computer Arithmetic 1 B O O K : C O M P U T E R O R G A N I Z A T I O N A N D D E S I G N, 3 E D, D A V I D L. P A T T E R S O N A N D J O H N L. H A N N E S S Y, M O R G A N K A U F M A N N

More information

Experimental Methods I

Experimental Methods I Experimental Methods I Computing: Data types and binary representation M.P. Vaughan Learning objectives Understanding data types for digital computers binary representation of different data types: Integers

More information

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR UNIT I Digital Systems: Binary Numbers, Octal, Hexa Decimal and other base numbers, Number base conversions, complements, signed binary numbers, Floating point number representation, binary codes, error

More information

Final Labs and Tutors

Final Labs and Tutors ICT106 Fundamentals of Computer Systems - Topic 2 REPRESENTATION AND STORAGE OF INFORMATION Reading: Linux Assembly Programming Language, Ch 2.4-2.9 and 3.6-3.8 Final Labs and Tutors Venue and time South

More information

BINARY SYSTEM. Binary system is used in digital systems because it is:

BINARY SYSTEM. Binary system is used in digital systems because it is: CHAPTER 2 CHAPTER CONTENTS 2.1 Binary System 2.2 Binary Arithmetic Operation 2.3 Signed & Unsigned Numbers 2.4 Arithmetic Operations of Signed Numbers 2.5 Hexadecimal Number System 2.6 Octal Number System

More information

Electronic Data and Instructions

Electronic Data and Instructions Lecture 2 - The information Layer Binary Values and Number Systems, Data Representation. Know the different types of numbers Describe positional notation Convert numbers in other bases to base 10 Convert

More information

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation Data Representation II CMSC 313 Sections 01, 02 The conversions we have so far presented have involved only unsigned numbers. To represent signed integers, computer systems allocate the high-order bit

More information

计算机信息表达. Information Representation 刘志磊天津大学智能与计算学部

计算机信息表达. Information Representation 刘志磊天津大学智能与计算学部 计算机信息表达 刘志磊天津大学智能与计算学部 Bits & Bytes Bytes & Letters More Bytes Bit ( 位 ) the smallest unit of storage Everything in a computer is 0 s and 1 s Bits why? Computer Hardware Chip uses electricity 0/1 states

More information

Binary Codes. Dr. Mudathir A. Fagiri

Binary Codes. Dr. Mudathir A. Fagiri Binary Codes Dr. Mudathir A. Fagiri Binary System The following are some of the technical terms used in binary system: Bit: It is the smallest unit of information used in a computer system. It can either

More information

Introduction to Numbering Systems

Introduction to Numbering Systems NUMBER SYSTEM Introduction to Numbering Systems We are all familiar with the decimal number system (Base 10). Some other number systems that we will work with are Binary Base 2 Octal Base 8 Hexadecimal

More information

Chapter 3 DATA REPRESENTATION

Chapter 3 DATA REPRESENTATION Page1 Chapter 3 DATA REPRESENTATION Digital Number Systems In digital systems like computers, the quantities are represented by symbols called digits. Many number systems are in use in digital technology

More information

MACHINE LEVEL REPRESENTATION OF DATA

MACHINE LEVEL REPRESENTATION OF DATA MACHINE LEVEL REPRESENTATION OF DATA CHAPTER 2 1 Objectives Understand how integers and fractional numbers are represented in binary Explore the relationship between decimal number system and number systems

More information

REPRESENTING INFORMATION:

REPRESENTING INFORMATION: REPRESENTING INFORMATION: BINARY, HEX, ASCII CORRESPONDING READING: WELL, NONE IN YOUR TEXT. SO LISTEN CAREFULLY IN LECTURE (BECAUSE IT WILL BE ON THE EXAM(S))! CMSC 150: Fall 2015 Controlling Information

More information

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1 IT 1204 Section 2.0 Data Representation and Arithmetic 2009, University of Colombo School of Computing 1 What is Analog and Digital The interpretation of an analog signal would correspond to a signal whose

More information

CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS

CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS INTRODUCTION Digital computers use sequences of binary digits (bits) to represent numbers, letters, special symbols, music, pictures, and videos.

More information

Number System. Introduction. Decimal Numbers

Number System. Introduction. Decimal Numbers Number System Introduction Number systems provide the basis for all operations in information processing systems. In a number system the information is divided into a group of symbols; for example, 26

More information

1.1. INTRODUCTION 1.2. NUMBER SYSTEMS

1.1. INTRODUCTION 1.2. NUMBER SYSTEMS Chapter 1. 1.1. INTRODUCTION Digital computers have brought about the information age that we live in today. Computers are important tools because they can locate and process enormous amounts of information

More information

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM COURSE / CODE DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) NUMBER SYSTEM A considerable subset of digital systems deals with arithmetic operations. To understand the

More information

MRIEHEL SECONDARY SCHOOL HALF-YEARLY EXAMINATIONS 2016~17. Year 9 Computing Time: 1hr 30mins MARKING SCHEME. a) CPU : b) MSB : c) GUI :

MRIEHEL SECONDARY SCHOOL HALF-YEARLY EXAMINATIONS 2016~17. Year 9 Computing Time: 1hr 30mins MARKING SCHEME. a) CPU : b) MSB : c) GUI : MRIEHEL SECONDARY SCHOOL HALF-YEARLY EXAMINATIONS 2016~17 Year 9 Computing Time: 1hr 30mins MARKING SCHEME 1. What do the following abbreviations stand for? Central Processing Unit a) CPU : Most Significant

More information

Chapter 2. Data Representation in Computer Systems

Chapter 2. Data Representation in Computer Systems Chapter 2 Data Representation in Computer Systems Chapter 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers. Master the skill of converting

More information

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Dec Hex Bin ORG ; ZERO. Introduction To Computing Dec Hex Bin 0 0 00000000 ORG ; ZERO Introduction To Computing OBJECTIVES this chapter enables the student to: Convert any number from base 2, base 10, or base 16 to any of the other two bases. Add and

More information

Number Systems CHAPTER Positional Number Systems

Number Systems CHAPTER Positional Number Systems CHAPTER 2 Number Systems Inside computers, information is encoded as patterns of bits because it is easy to construct electronic circuits that exhibit the two alternative states, 0 and 1. The meaning of

More information

[301] Bits and Memory. Tyler Caraza-Harter

[301] Bits and Memory. Tyler Caraza-Harter [301] Bits and Memory Tyler Caraza-Harter Ones and Zeros 01111111110101011000110010011011000010010001100110101101 01000101110110000000110011101011101111000110101010010011 00011000100110001010111010110001010011101000100110100000

More information

Digital Systems COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

Digital Systems COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals Digital Systems COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals Welcome to COE 202 Course Webpage: http://faculty.kfupm.edu.sa/coe/mudawar/coe202/ Lecture

More information

Numbering systems. Dr Abu Arqoub

Numbering systems. Dr Abu Arqoub Numbering systems The decimal numbering system is widely used, because the people Accustomed (معتاد) to use the hand fingers in their counting. But with the development of the computer science another

More information

Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2

Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2 Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2 Instructor: Rob Bergen Applied Computer Science University of Winnipeg Announcements Website is up

More information

CC411: Introduction To Microprocessors

CC411: Introduction To Microprocessors CC411: Introduction To Microprocessors OBJECTIVES this chapter enables the student to: Use number { base 2, base 10, or base 16 }. Add and subtract binary/hex numbers. Represent any binary number in 2

More information

Number Systems MA1S1. Tristan McLoughlin. November 27, 2013

Number Systems MA1S1. Tristan McLoughlin. November 27, 2013 Number Systems MA1S1 Tristan McLoughlin November 27, 2013 http://en.wikipedia.org/wiki/binary numeral system http://accu.org/index.php/articles/1558 http://www.binaryconvert.com http://en.wikipedia.org/wiki/ascii

More information

Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng

Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng Slide Set 1 for ENEL 339 Fall 2014 Lecture Section 02 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Fall Term, 2014 ENEL 353 F14 Section

More information

UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES

UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES Structure 2.0 Introduction 2.1 Unit Objectives 2.2 Number Systems 2.3 Bits and Bytes 2.4 Binary Number System 2.5 Decimal Number System 2.6 Octal Number System

More information

Decimal & Binary Representation Systems. Decimal & Binary Representation Systems

Decimal & Binary Representation Systems. Decimal & Binary Representation Systems Decimal & Binary Representation Systems Decimal & binary are positional representation systems each position has a value: d*base i for example: 321 10 = 3*10 2 + 2*10 1 + 1*10 0 for example: 101000001

More information

Introduction to Computers and Programming. Numeric Values

Introduction to Computers and Programming. Numeric Values Introduction to Computers and Programming Prof. I. K. Lundqvist Lecture 5 Reading: B pp. 47-71 Sept 1 003 Numeric Values Storing the value of 5 10 using ASCII: 00110010 00110101 Binary notation: 00000000

More information

TOPIC: NUMBER SYSTEMS

TOPIC: NUMBER SYSTEMS Ministry of Secondary Education Progressive Comprehensive High School PCHS Mankon Bamenda Department of Computer Studies Republic of Cameroon Peace Work - Fatherland TOPIC: NUMBER SYSTEMS Class: Comp.

More information

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700: Digital Logic Design Winter Notes - Unit 4. hundreds.

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700: Digital Logic Design Winter Notes - Unit 4. hundreds. UNSIGNED INTEGER NUMBERS Notes - Unit 4 DECIMAL NUMBER SYSTEM A decimal digit can take values from to 9: Digit-by-digit representation of a positive integer number (powers of ): DIGIT 3 4 5 6 7 8 9 Number:

More information

Unit - II. Computer Concepts and C Programming 06CCP13. Unit II

Unit - II. Computer Concepts and C Programming 06CCP13. Unit II Computer Concepts and C Programming () Unit II Unit Division Unit-II (6 Hours) Processing Data Storing Data Topics Transforming Data into Information How computers represent data How computers process

More information

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems SCHOOL OF ENGINEERING & BUILT ENVIRONMENT Mathematics Numbers & Number Systems Introduction Numbers and Their Properties Multiples and Factors The Division Algorithm Prime and Composite Numbers Prime Factors

More information

Lecture 1: What is a computer?

Lecture 1: What is a computer? 02-201, Fall 2015, Carl Kingsford Lecture 1: What is a computer? 0. Today's Topics Basic computer architecture How the computer represents data 1. What is a computer? A modern computer is a collection

More information

Topic Notes: Bits and Bytes and Numbers

Topic Notes: Bits and Bytes and Numbers Computer Science 220 Assembly Language & Comp Architecture Siena College Fall 2010 Topic Notes: Bits and Bytes and Numbers Binary Basics At least some of this will be review, but we will go over it for

More information

History of Computing. Ahmed Sallam 11/28/2014 1

History of Computing. Ahmed Sallam 11/28/2014 1 History of Computing Ahmed Sallam 11/28/2014 1 Outline Blast from the past Layered Perspective of Computing Why Assembly? Data Representation Base 2, 8, 10, 16 Number systems Boolean operations and algebra

More information

NUMBER SYSTEMS AND CODES

NUMBER SYSTEMS AND CODES C H A P T E R 69 Learning Objectives Number Systems The Decimal Number System Binary Number System Binary to Decimal Conversion Binary Fractions Double-Dadd Method Decimal to Binary Conversion Shifting

More information

Binary. Hexadecimal BINARY CODED DECIMAL

Binary. Hexadecimal BINARY CODED DECIMAL Logical operators Common arithmetic operators, like plus, minus, multiply and divide, works in any number base but the binary number system provides some further operators, called logical operators. Meaning

More information

Chapter 1 Review of Number Systems

Chapter 1 Review of Number Systems 1.1 Introduction Chapter 1 Review of Number Systems Before the inception of digital computers, the only number system that was in common use is the decimal number system which has a total of 10 digits

More information

Computer Organization

Computer Organization Computer Organization Register Transfer Logic Number System Department of Computer Science Missouri University of Science & Technology hurson@mst.edu 1 Decimal Numbers: Base 10 Digits: 0, 1, 2, 3, 4, 5,

More information

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-278: Digital Logic Design Fall Notes - Unit 4. hundreds.

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-278: Digital Logic Design Fall Notes - Unit 4. hundreds. ECE-78: Digital Logic Design Fall 6 UNSIGNED INTEGER NUMBERS Notes - Unit 4 DECIMAL NUMBER SYSTEM A decimal digit can take values from to 9: Digit-by-digit representation of a positive integer number (powers

More information

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar Data Representation COE 30 Computer Organization Prof. Muhamed Mudawar College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals Presentation Outline Positional Number

More information

DATA REPRESENTATION. By- Neha Tyagi PGT CS KV 5 Jaipur II Shift, Jaipur Region. Based on CBSE curriculum Class 11. Neha Tyagi, KV 5 Jaipur II Shift

DATA REPRESENTATION. By- Neha Tyagi PGT CS KV 5 Jaipur II Shift, Jaipur Region. Based on CBSE curriculum Class 11. Neha Tyagi, KV 5 Jaipur II Shift DATA REPRESENTATION Based on CBSE curriculum Class 11 By- Neha Tyagi PGT CS KV 5 Jaipur II Shift, Jaipur Region Neha Tyagi, KV 5 Jaipur II Shift Introduction As we know that computer system stores any

More information

Computers Are Your Future

Computers Are Your Future Computers Are Your Future Twelfth Edition Chapter 2: Inside the System Unit Copyright 2012 Pearson Education, Inc. Publishing as Prentice Hall 1 Inside the Computer System Copyright 2012 Pearson Education,

More information

Internal Data Representation

Internal Data Representation Appendices This part consists of seven appendices, which provide a wealth of reference material. Appendix A primarily discusses the number systems and their internal representation. Appendix B gives information

More information

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur 1 Number Representation 2 1 Topics to be Discussed How are numeric data items actually

More information

umber Systems bit nibble byte word binary decimal

umber Systems bit nibble byte word binary decimal umber Systems Inside today s computers, data is represented as 1 s and 0 s. These 1 s and 0 s might be stored magnetically on a disk, or as a state in a transistor. To perform useful operations on these

More information

MRIEHEL SECONDARY SCHOOL HALF-YEARLY EXAMINATIONS 2016~17. Year 9 Computing Time: 1hr 30mins

MRIEHEL SECONDARY SCHOOL HALF-YEARLY EXAMINATIONS 2016~17. Year 9 Computing Time: 1hr 30mins MRIEHEL SECONDARY SCHOOL HALF-YEARLY EXAMINATIONS 2016~17 Year 9 Computing Time: 1hr 30mins Name: Class: Please read the following instructions carefully: 1. Answer ALL the questions in the space provided

More information

Microprocessors I MICROCOMPUTERS AND MICROPROCESSORS

Microprocessors I MICROCOMPUTERS AND MICROPROCESSORS Microprocessors I Outline of the Lecture Microcomputers and Microprocessors Evolution of Intel 80x86 Family Microprocessors Binary and Hexadecimal Number Systems MICROCOMPUTERS AND MICROPROCESSORS There

More information

OBJECTIVES After reading this chapter, the student should be able to:

OBJECTIVES After reading this chapter, the student should be able to: Data Representation OBJECTIVES After reading this chapter, the student should be able to: Define data types. Visualize how data are stored inside a computer. Understand the differences between text, numbers,

More information

Discussion. Why do we use Base 10?

Discussion. Why do we use Base 10? MEASURING DATA Data (the plural of datum) are anything in a form suitable for use with a computer. Whatever a computer receives as an input is data. Data are raw facts without any clear meaning. Computers

More information

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Bits and Bytes and Numbers

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Bits and Bytes and Numbers Computer Science 324 Computer Architecture Mount Holyoke College Fall 2007 Topic Notes: Bits and Bytes and Numbers Number Systems Much of this is review, given the 221 prerequisite Question: how high can

More information

World Inside a Computer is Binary

World Inside a Computer is Binary C Programming 1 Representation of int data World Inside a Computer is Binary C Programming 2 Decimal Number System Basic symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Radix-10 positional number system. The radix

More information

Review of Number Systems

Review of Number Systems Review of Number Systems The study of number systems is important from the viewpoint of understanding how data are represented before they can be processed by any digital system including a digital computer.

More information

Digital Systems. John SUM Institute of Technology Management National Chung Hsing University Taichung, ROC. December 6, 2012

Digital Systems. John SUM Institute of Technology Management National Chung Hsing University Taichung, ROC. December 6, 2012 Digital Systems John SUM Institute of Technology Management National Chung Hsing University Taichung, ROC December 6, 2012 Contents 1 Logic Gates 3 1.1 Logic Gate............................. 3 1.2 Truth

More information

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums plc numbers - 3. 3. NUMBERS AND DATA Topics: Number bases; binary, octal,, hexa Binary calculations; s compliments, addition, subtraction and Boolean operations Encoded values; BCD and ASCII Error detection;

More information

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS Aleksandar Milenković The LaCASA Laboratory, ECE Department, The University of Alabama in Huntsville Email: milenka@uah.edu Web:

More information

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010 Contents Number systems and conversion Binary arithmetic Representation of negative numbers Addition of two s complement numbers Addition of one s complement numbers Binary s Readings Unit.~. UNIT NUMBER

More information

Intermediate Programming & Design (C++) Notation

Intermediate Programming & Design (C++) Notation Notation Byte = 8 bits (a sequence of 0 s and 1 s) To indicate larger amounts of storage, some prefixes taken from the metric system are used One kilobyte (KB) = 2 10 bytes = 1024 bytes 10 3 bytes One

More information

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 CS 64 Lecture 2 Data Representation Reading: FLD 1.2-1.4 Decimal Numbers: Base 10 Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Example: 3271 = (3x10 3 ) + (2x10 2 ) + (7x10 1 ) + (1x10 0 ) 1010 10?= 1010 2?= 1

More information

Logic Circuits I ECE 1411 Thursday 4:45pm-7:20pm. Nathan Pihlstrom.

Logic Circuits I ECE 1411 Thursday 4:45pm-7:20pm. Nathan Pihlstrom. Logic Circuits I ECE 1411 Thursday 4:45pm-7:20pm Nathan Pihlstrom www.uccs.edu/~npihlstr My Background B.S.E.E. from Colorado State University M.S.E.E. from Colorado State University M.B.A. from UCCS Ford

More information

User. Application program. Interfaces. Operating system. Hardware

User. Application program. Interfaces. Operating system. Hardware Operating Systems Introduction to Operating Systems and Computer Hardware Introduction and Overview The operating system is a set of system software routines that interface between an application program

More information

Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997

Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997 Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997 APPENDIX A.1 Number systems and codes Since ten-fingered humans are addicted to the decimal system, and since computers

More information

Audio Text for the Lesson: Counting Systems

Audio Text for the Lesson: Counting Systems Audio Text for the Lesson: Counting Systems Part 1: Introduction (2 minutes) Peace, mercy and blessings of Allah Welcome everyone in this lesson Allow me to introduce myself, my name is Abdullah Saleh

More information

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Chapter Overview. Welcome to Assembly Language

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Chapter Overview. Welcome to Assembly Language Assembly Language for Intel-Based Computers, 4 th Edition Kip R. Irvine Chapter 1: Basic Concepts Slides prepared by Kip R. Irvine Revision date: 09/15/2002 Chapter corrections (Web) Printing a slide show

More information

CMSC 1513 Lecture 1.2

CMSC 1513 Lecture 1.2 Key Point: A computer is an electronic device that stores and processes data. Hardware Software Hardware comprises the visible, physical elements of the computer. Software provides the invisible instructions

More information

Topic Notes: Bits and Bytes and Numbers

Topic Notes: Bits and Bytes and Numbers Computer Science 220 Assembly Language & Comp Architecture Siena College Fall 2011 Topic Notes: Bits and Bytes and Numbers Binary Basics At least some of this will be review for most of you, but we start

More information

Digital Systems and Binary Numbers

Digital Systems and Binary Numbers Digital Systems and Binary Numbers Prof. Wangrok Oh Dept. of Information Communications Eng. Chungnam National University Prof. Wangrok Oh(CNU) 1 / 51 Overview 1 Course Summary 2 Binary Numbers 3 Number-Base

More information

Bits, Words, and Integers

Bits, Words, and Integers Computer Science 52 Bits, Words, and Integers Spring Semester, 2017 In this document, we look at how bits are organized into meaningful data. In particular, we will see the details of how integers are

More information

Chapter 4: Data Representations

Chapter 4: Data Representations Chapter 4: Data Representations Integer Representations o unsigned o sign-magnitude o one's complement o two's complement o bias o comparison o sign extension o overflow Character Representations Floating

More information

Digital Fundamentals

Digital Fundamentals Digital Fundamentals Tenth Edition Floyd Chapter 2 2009 Pearson Education, Upper 2008 Pearson Saddle River, Education NJ 07458. All Rights Reserved Decimal Numbers The position of each digit in a weighted

More information

Computers Are Your Future

Computers Are Your Future Computers Are Your Future 2008 Prentice-Hall, Inc. Computers Are Your Future Chapter 6 Inside the System Unit 2008 Prentice-Hall, Inc. Slide 2 What You Will Learn... Understand how computers represent

More information

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS (09 periods) Computer Arithmetic: Data Representation, Fixed Point Representation, Floating Point Representation, Addition and

More information

DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS

DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS C H A P T E R 6 DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS OUTLINE 6- Binary Addition 6-2 Representing Signed Numbers 6-3 Addition in the 2 s- Complement System 6-4 Subtraction in the 2 s- Complement

More information

Numbers and Computers. Debdeep Mukhopadhyay Assistant Professor Dept of Computer Sc and Engg IIT Madras

Numbers and Computers. Debdeep Mukhopadhyay Assistant Professor Dept of Computer Sc and Engg IIT Madras Numbers and Computers Debdeep Mukhopadhyay Assistant Professor Dept of Computer Sc and Engg IIT Madras 1 Think of a number between 1 and 15 8 9 10 11 12 13 14 15 4 5 6 7 12 13 14 15 2 3 6 7 10 11 14 15

More information

Number Systems (2.1.1)

Number Systems (2.1.1) Number Systems (2.1.1) Concept of a register. Operations of register, Complementation, Ranges, Left and right shifts, Addition of two binary number, Numerical overflow, 2 s complement representation, Binary

More information

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS Aleksandar Milenković The LaCASA Laboratory, ECE Department, The University of Alabama in Huntsville Email: milenka@uah.edu Web:

More information

Chapter 4. Operations on Data

Chapter 4. Operations on Data Chapter 4 Operations on Data 1 OBJECTIVES After reading this chapter, the reader should be able to: List the three categories of operations performed on data. Perform unary and binary logic operations

More information

Logic, Words, and Integers

Logic, Words, and Integers Computer Science 52 Logic, Words, and Integers 1 Words and Data The basic unit of information in a computer is the bit; it is simply a quantity that takes one of two values, 0 or 1. A sequence of k bits

More information

The Building Blocks: Binary Numbers, Boolean Logic, and Gates. Purpose of Chapter. External Representation of Information.

The Building Blocks: Binary Numbers, Boolean Logic, and Gates. Purpose of Chapter. External Representation of Information. The Building Blocks: Binary Numbers, Boolean Logic, and Gates Chapter 4 Representing Information The Binary Numbering System Boolean Logic and Gates Building Computer Circuits Control Circuits CMPUT Introduction

More information

D I G I T A L C I R C U I T S E E

D I G I T A L C I R C U I T S E E D I G I T A L C I R C U I T S E E Digital Circuits Basic Scope and Introduction This book covers theory solved examples and previous year gate question for following topics: Number system, Boolean algebra,

More information

EE292: Fundamentals of ECE

EE292: Fundamentals of ECE EE292: Fundamentals of ECE Fall 2012 TTh 10:00-11:15 SEB 1242 Lecture 22 121115 http://www.ee.unlv.edu/~b1morris/ee292/ 2 Outline Review Binary Number Representation Binary Arithmetic Combinatorial Logic

More information

Bits and Bit Patterns

Bits and Bit Patterns Bits and Bit Patterns Bit: Binary Digit (0 or 1) Bit Patterns are used to represent information. Numbers Text characters Images Sound And others 0-1 Boolean Operations Boolean Operation: An operation that

More information

IB Computer Science Topic.2-

IB Computer Science Topic.2- Topic.2- Computer Organization Designed by: Allan Lawson Sources: Online Materials, thanks for all Topic 2.1.1 Computer Architecture Outline the architecture of a central processing unit (CPU) and the

More information

M1 Computers and Data

M1 Computers and Data M1 Computers and Data Module Outline Architecture vs. Organization. Computer system and its submodules. Concept of frequency. Processor performance equation. Representation of information characters, signed

More information

Kinds Of Data CHAPTER 3 DATA REPRESENTATION. Numbers Are Different! Positional Number Systems. Text. Numbers. Other

Kinds Of Data CHAPTER 3 DATA REPRESENTATION. Numbers Are Different! Positional Number Systems. Text. Numbers. Other Kinds Of Data CHAPTER 3 DATA REPRESENTATION Numbers Integers Unsigned Signed Reals Fixed-Point Floating-Point Binary-Coded Decimal Text ASCII Characters Strings Other Graphics Images Video Audio Numbers

More information

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning 4 Operations On Data 4.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List the three categories of operations performed on data.

More information

Software and Hardware

Software and Hardware Software and Hardware Numbers At the most fundamental level, a computer manipulates electricity according to specific rules To make those rules produce something useful, we need to associate the electrical

More information

Information Science 1

Information Science 1 Information Science 1 -Basic Concepts of Computers: Opera4on, Architecture, Memory- Week 02 College of Information Science and Engineering Ritsumeikan University Today s lecture outline l Recall the previous

More information

OCR J276 GCSE Computer Science

OCR J276 GCSE Computer Science Name: Class Teacher: Date: OCR J276 GCSE Computer Science REVISION BOOKLET 2.6 DATA REPRESENTATION Content in J276 GCSE Computer Science: 1.1 Systems Architecture 1.2 Memory 1.3 Storage 1.4 Wireless and

More information

Chapter 9: A Closer Look at System Hardware

Chapter 9: A Closer Look at System Hardware Chapter 9: A Closer Look at System Hardware CS10001 Computer Literacy Chapter 9: A Closer Look at System Hardware 1 Topics Discussed Digital Data and Switches Manual Electrical Digital Data Representation

More information

Chapter 9: A Closer Look at System Hardware 4

Chapter 9: A Closer Look at System Hardware 4 Chapter 9: A Closer Look at System Hardware CS10001 Computer Literacy Topics Discussed Digital Data and Switches Manual Electrical Digital Data Representation Decimal to Binary (Numbers) Characters and

More information