Block Diagram of BCD Adder in Computer Architecture

Ginni
Updated on 30-Jul-2021 13:26:29

10K+ Views

BCD adder refers to a 4-bit binary adder that can add two 4-bit words of BCD format. The output of the addition is a BCD-format 4-bit output word. It can descript the decimal sum of the addend and augend and a carry that is created in case this sum exceeds a decimal value of 9. Therefore, BCD adders can perform decimal addition.A BCD adder is a circuit that adds two BCD digits in parallel and makes a sum digit also in BCD. A BCD adder should contain the correction logic in its internal construction. To add 0110 to the binary ... Read More

Decimal Arithmetic Operations in Computer Architecture

Ginni
Updated on 30-Jul-2021 13:23:01

8K+ Views

Decimal arithmetic operations refer to a digital function that does decimal micro-operations. This function adds or subtracts decimal numbers by forming 9’s or 10’s complement of the subtrahend. This decimal arithmetic unit first accepts coded decimal numbers and then generates output in the binary form.Algorithms that are used for arithmetic operations with decimal data and binary data are alike. If the micro-operations symbol is interpreted correctly the same flowchart can be used for both multiplication and division.The decimal numbers in BCD are stored in groups of four bits in the computer registers. When performing decimal micro-operations, every 4-bit group represents ... Read More

BCD Subtraction in Computer Architecture

Ginni
Updated on 30-Jul-2021 13:20:42

6K+ Views

A subtractor circuit is required to perform a subtraction operation on two decimal numbers. BCD subtraction is slightly different from BCD addition. Performing subtraction operation by taking the 9’s or 10’s complement of the subtrahend and adding it to the minuend is economical.It is not possible to obtain the 9’s complement by complementing every bit in the code because the BCD is not a self- complementing code. The 9’s complement has to be formed by a circuit that subtracts Notes every BCD number from 9.The 9’s complement of a decimal digit that is represented in BCD can be obtained by ... Read More

What is BCD Adder in Computer Architecture

Ginni
Updated on 30-Jul-2021 13:19:35

12K+ Views

BCD adder refers to a 4-bit binary adder that can add two 4-bit words of BCD format. The output of the addition is a BCD-format 4-bit output word, which defines the decimal sum of the addend and augend and a carry that is created in case this sum exceeds a decimal value of 9. Therefore, BCD adders can implement decimal addition.Construction of BCD AdderSum of Binary DigitsSum of BCD DigitsKZ8Z4Z2Z1CS8S4S2S1Decimal00000000000000010000110001000010200011000113001000010040010100101500110001106001110011170100001000801001010019010101001010010111001111011001000012011011000113011101011014011111011115100001010016100011010117100101101018100111101119In this table, K is the carry. The subscripts below the letter Z define the weights. The weights, according to the table, are 8, 4, 2, and 1. These weights can ... Read More

Use isgraph in Arduino

Yash Sanghvi
Updated on 30-Jul-2021 12:53:49

329 Views

The isGraph() function is very similar to the isPrintable() function in Arduino. The only difference is that isGraph() returns true only if the character being printed has some content.So, blank space gets excluded by isGraph() but included by isPrintable(). All normal characters, numbers, special characters, which have some content will return true when passed through isGraph().SyntaxThe syntax is −isGraph(myChar)Where myChar is the character being checked. A quick question. Will the tab and new line characters return true with isGraph().ExampleValidate your answer with a simple code like below −void setup() {    // put your setup code here, to run once: ... Read More

Shift In and Shift Out in Arduino

Yash Sanghvi
Updated on 30-Jul-2021 12:52:28

2K+ Views

shiftIn() and shiftOut() commands in Arduino are, very loosely speaking, software implementations of SPI. Of course, SPI is much faster, but SPI can work only on some specific pins of Arduino. shiftIn() and shiftOut() can use any two GPIOs of Arduino (not some specific pins like SPI).Both shiftIn() and shiftOut() require two digital pins, one dataPin and one clockPin.The dataPin will shift in or shift out a byte (8 bits) of data, 1 bit at a time. The clockPin synchronizes the data transfer. It is generally kept low, and for each bit transfer, it goes HIGH and then back to ... Read More

PulseIn and PulseInLong in Arduino

Yash Sanghvi
Updated on 30-Jul-2021 12:50:29

3K+ Views

If there is an incoming pulse on a pin, and you need to measure the duration of the pulse then the pulseIn() function comes in handy.SyntaxThe syntax is −pulseIn(pin, value)Where pin is the number of the pin on which you wish to measure the pulse. The value is the level of the pulse. It can be HIGH or LOW.For example, if you set the value to HIGH, it means that as soon as the voltage on the pin goes from LOW to HIGH, the measurement of the time will start. It will stop when the voltage on the pin goes ... Read More

Tone and NoTone in Arduino

Yash Sanghvi
Updated on 30-Jul-2021 12:45:59

6K+ Views

The tone function can be used to generate a square wave (50% duty cycle) of a specific frequency on a pin.SyntaxThe syntax is −tone(pin, frequency)pin is the pin number on which to generate the tone. The frequency is specified in Hz.This function can also take in a third optional argument − the millisecond duration for which the tone should be generated on the pin.tone(pin, frequency, duration)If you don’t specify the duration, the tone will continue till the noTone() function is called on the same pin. The syntax of the noTone() function is −noTone(pin)where pin is the pin number on which ... Read More

Read Contents of a File in Golang

Rishikesh Kumar Rishi
Updated on 30-Jul-2021 09:44:00

1K+ Views

pre.prettyprint{width:99%!important;} a.demo{top:12px!important; float:right!important;}To read the contents of a file, we can take following steps −We can create a file called test.txt.Clean-up using defer statement.Write the contents of string.Call ReadFile() method to read the file.ReadFile reads the file named by filename and returns the contents.Print the content of the file.Example Live Demopackage main import (    "fmt"    "io/ioutil"    "log"    "os" ) func CreateFile() {    file, err := os.Create("test.txt")    if err != nil {       log.Fatalf("failed creating file: %s", err)    }    defer file.Close()    _, err = file.WriteString("Welcome to Tutorials Point")    if err ... Read More

Set LD_LIBRARY_PATH Environmental Variable in Linux

Mukul Latiyan
Updated on 30-Jul-2021 09:18:06

6K+ Views

There are plenty of ways in which we can set an environment variable in Linux and then make use of it later. Some ways provide us access to that variable in a particular window, in other cases, we can get access to those variables in every terminal window and in a permanent manner.Let’s explore setting a new environment variable on an Ubuntu machine and then we can talk about setting the LD_LIBRARY_PATH.In order to set a new environment variable, follow the commands shown below in sequence.Command 1Open your bash-profile with the command shown below −vi ~/.bashrcCommand 2Make use of the ... Read More

Advertisements