Skip to main content

Addition and Subtraction of Binary Numbers

The best way to remember how to add binary integers is by knowing the way they break down such as, 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 0 but remember to carry the 1 to the next significant bit. In the addition example posted below, the equation is using the 32-bit binary version of the integers 14 and 13 and generating a result of 27. 

              0000 0000 0000 0000 0000 0000 0000 1110    (14) 

        +    0000 0000 0000 0000 0000 0000 0000 1101    (13) 

_________________________________________________

              0000 0000 0000 0000 0000 0000 0001 1011    (27) 

The rules for subtraction can be just as easy by remembering the following rules, 0 – 0 = 0, 1 – 0 = 1, 1 – 1 = 0, and 0 – 1 = 1 but remember to borrow 1 from the next more significant bit. In the subtraction example posted below, the equation is using the 32-bit binary version of the integers 14 and 13 and generating a result of 1. 

               0000 0000 0000 0000 0000 0000 0000 1110    (14) 

        -     0000 0000 0000 0000 0000 0000 0000 1101    (13) 

_________________________________________________

               0000 0000 0000 0000 0000 0000 0000 0001    (1) 

Patterson and Hennessy (2014) define overflow as “the result from an operation cannot be represented with the available hardware”. An example of when overflow can occur is when you add two signed positive integers and get a negative integer for the result. For example, a signed 8-bit integer can only go as high as +127. So, when you add 3 to 127 it creates an overflow because the operation cannot be expressed in an 8-bit signed integer. An example of when overflow cannot occur is when you add positive integer and a negative integer as the sum must be no larger than one of the operands. Overflow can occur in subtraction when you subtract a negative number from a positive number and get a negative result, or when you subtract a positive number from a negative number and get a positive result. 


References 

Shet, R. (2020, February 2). Binary arithmetic - all rules and Operations. Technobyte. Retrieved November 18, 2021, from https://technobyte.org/binary-arithmetic-rules/ 

Patterson, D. A., & Hennessy, J. L. (2014). Computer organization and design: The hardware/software interface (5th ed.). Retrieved from https://zybooks.zyante.com/ 



Comments

Popular posts from this blog

Peering Points and the Network Application Interface

According to Gibb (2019), “Peering is a method that allows two networks to connect and exchange traffic directly without having to pay a third party to carry traffic across the Internet.” Utilizing a peering point allows users to send a receive data directly to one another without the need to route through other computer networks. Doing so allows for a quicker, more efficient, and safer form of communication.  Researching the total number of active Internet Exchange Points (IXP) proved difficult as it was hard to pinpoint an accurate number. However, according to Rosas (2021), “as of January 2021, of the 630 registered IXPs, 229 are in Europe, 126 in North America, 140 in Asia-Pacific, 96 in Latin America and the Caribbean (LAC), and 39 in Africa.” These numbers are constantly changing as new IXPs are added, and some are removed.  Finding a definitive number of Internet Service Providers (ISP) globally was also difficult to accomplish. Most sources seem to point to the Nations Encyclop

VLAN Aggregation for Efficient IP Address Allocation

The project I chose to summarize on the Internet Engineering Task Force (IETF) website was RFC: 3069, VLAN Aggregation for Efficient IP Address Allocation. Within this project, the authors point out how inefficiently a Virtual Local Area Network (VLAN) allocates IP addresses along with their proposed solutions. I have also attached a diagram showing how the network would look pertaining to this project. Currently, an IP subnet would be made for each existing customer by understanding how many hosts they currently need and may need in the future. Based on that total number, the IP subnet and gateway address would change according to how many hosts the customer requested. For example, if a customer has indicated that they need ten hosts, and they only use five, the additional five that are not in use cannot be used by another customer. An illustration of this is shown below. The proposed solution to this problem is to allocate IP addresses under the same IP subnet and gateway address uti

Hard Drive Disk-Scheduling Algorithms

First­-Come­-First­-Served (FCFS) The first­-come-first­-served (FCFS) algorithm is designed to handle requests in the order they are received, regardless of where the head is located within the disk drive. Even though this is most fair algorithm out of the three, it is also the least efficient. The graph below shows how inconsistently the head had to travel in order to serve the requests that were being sent. Shortest-­Seek­-Time-­First (SSTF) The shortest­-seek-­time-­first algorithm aims to handle requests with the shortest seek time from the current head location. This algorithm surprised me as I thought it was going to be more efficient than the FCFS algorithm. As shown in the graph, this algorithm was performing very well until a request was sent at cylinder 17. In this case the head waited to serve the request at cylinder 17 until very last which forced the head to travel a long distance. SCAN The SCAN algorithm handles requests by moving the arm from one end of the cylinder to