0% found this document useful (0 votes)
6 views20 pages

LectureSlides 1 Fundamentals

The document covers fundamental concepts in computer science, including computer memory hierarchy, types of software, and the binary number system. It explains the representation of negative binary numbers using sign bit and 2's complement, highlighting the efficiency of 2's complement. Additionally, it introduces algorithms and flowcharts as tools for problem-solving in programming.

Uploaded by

cgrewalbe24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as KEY, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views20 pages

LectureSlides 1 Fundamentals

The document covers fundamental concepts in computer science, including computer memory hierarchy, types of software, and the binary number system. It explains the representation of negative binary numbers using sign bit and 2's complement, highlighting the efficiency of 2's complement. Additionally, it introduces algorithms and flowcharts as tools for problem-solving in programming.

Uploaded by

cgrewalbe24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as KEY, PDF, TXT or read online on Scribd
You are on page 1/ 20

Topics covered

Introduction to Computer
Fundamentals- Computer Memory
Hierarchy, Types of Software Binary
number system, Algorithm, Flowchart,
Formulate simple algorithms for logical and
arithmetic problems.
Memory
Hierarchy
Types of softwares
Binary to decimal (positive only)
Decimal to binary (positives
only)
Negative binary numbers
(i) Sign bit representation - left most bit tells
the sign and rest of the bits is the value. Left bit
0 means positive and 1 means negative. For
example 1101 = 1 101 = -5

(ii) 2’s complement - take 1’s complement (flip


all the bits) and then add 1 as shown in the next
slide.
Sign bit versus 2’s
complement?
Given binary numbers 1000 and 0000 in sign bit
then their decimal equivalents are -0 and +0
which is essentially the same thing. So 1000 =
0000 which is not efficient representation.

Given binary numbers 1000 and 0000 in 2’s


complement then it means -8 and 0 respectively.
Therefore 2’s complement is efficient and
popular.
2’s complement

Circular diagram ahead to show 2’s


complement notation
Negative
binary
numbers: 2’s
complement
Flip zeros
and ones and
add 1
2’s
complement
1101 into unsigned and 2’s
complement signed notation
Unsigned (+): So 1101 = 13 in decimal
Signed (+/-) 2’s complement notation: If
the most significant bit (MSB) is 1 then
number is negative. So 1101 means a
negative number. Then find its 2’s
complement to find its value which is
0011. So 1101 = -3. Thus if 1101 is in
2’s complement then it is -3 in decimal.
Find signed decimal values for
10100101 and 01111111 using 2’s
complement.
Calculate the following

Convert decimal notation -30 into binary


using SIGN BIT representation

Convert decimal notation -30 into binary


using 2’s complement notation.

Hint: Find out how many bits to you need. For


example if there is -30 then there should be +30
so total 60+1 (including 0) and thus you need 6
bits atleast.
Algorithm

Finite sequence of explicit and


unambiguous instructions, which when
provided with a set of input values
produces an output and then terminates.
Flowchart

It is a pictorial form of an algo


Boxes represent operations and arrows
represent sequence in which the
operations are executed
Formulate simple algorithms for
logical and arithmetic problems

Practice to make algorithms and flowcharts


from your lab assignment problems and
discuss with the lab teacher if any
question.

You might also like