Questions tagged [register]

A special, high-speed storage area within the CPU.

Filter by
Sorted by
Tagged with
17
votes
4answers
3k views

What stops an assembly program from crashing the operating system? [closed]

First of all, I am a beginner, so if this question sounds silly, please point out the incorrect assumptions. From what I understand, the job of an operating system is to manage hardware and the ...
13
votes
1answer
6k views

What does banking mean when applied to registers?

This answer to a question on StackOverflow about what banking means in the context of ARM's banked registers indicates that there is some confusion about the meaning of banking when applied to ...
13
votes
3answers
14k views

What actually is a shadow register?

I noticed the term Shadow Register while going through a datasheet of a TMS320F28335 DSP. What does it actually mean? Does it have a physical location in the CPU as ...
9
votes
3answers
6k views

Do AVR registers and ports need to be initialized to zero?

During the initialization routine of my code I use to do such things as: clr r0 ; will always stay zero and: ...
8
votes
1answer
1k views

8-Bit stereo audio R-2R DAC, is this a right way to do it?

I am new to electrical engineering and the first project I would like to do is making a digital to analog audioconverter. I've found out that a good way to do this is to use an R-2R structure for the ...
7
votes
9answers
6k views

Microprocessors/Microcontrollers - Do registers have addresses?

My Embedded Systems professor keeps referring to the memory locations of registers as their respective "addresses". I'm confused by this; I was always under the impression that in any microprocessor, ...
6
votes
8answers
3k views

What prevents the construction of a CPU with all necessary memory represented in registers? [duplicate]

Modern CPUs employ a hierarchy of memory technologies. Registers, built into the chip have the lowest access times, but are expensive and volatile. Cache is a middle-man between RAM and registers to ...
6
votes
5answers
1k views

stack cache instead of registers

Is there a processor that do arithmetic operations on a stack and not on registers? To keep performance, of course, that processor should cache top block of a stack in the same type of memory that is ...
6
votes
3answers
3k views

Clocked edge-triggered timing (contamination delay)

I'm reading a book about computer architecture, and it says that, in clocked edge-triggered devices, the contamination delay is usually nonzero, and that the contamination delay for registers is ...
5
votes
5answers
492 views

Processing ADC conversion result: DMA vs Processor Registers

I have a periodic ADC conversion (every 50 micro-seconds) and I use the result to do some further calculations and update the PWM load registers. The ADC is triggered by the up-down counter of ...
5
votes
3answers
3k views

What is the underlying mechanism behind RO or WO and WR registers?

In embedded systems you have read only and write only registers. How are the two type distinguished in the produced netlist? How one builds a flop which you can only write to and not read from?
5
votes
1answer
743 views

One-clock increment operation in a three-bus CPU architecture

In his chapter on CPU design, Edward Bosworth introduces the following three-bus architecture: One of the main design aims of this circuit is to be able to increment the program counter PC in a ...
5
votes
4answers
35k views

What is the difference between registers, flip flops and latches?

I want the answer to the very basic level. I know what they mean individually, but what I am looking for is connection between them.
5
votes
1answer
3k views

Converting AVR assembly to machine code - addressing registers?

In AVR Assembly - I want to work out the machine code representation of the following: ANDI r18,$10 I know the opcode for ANDI is ...
4
votes
3answers
4k views

What is the main difference between registers, bit fields, and flags?

In school I was accustomed to programming various registers when working with microcontrollers to manipulate their behavior. At my job registers are now referred to purely as bit fields. The word "...
4
votes
2answers
17k views

What is the difference between TCCR1A and TCCR1B [closed]

I had an error in the configuration of PWM for the atmega8 because I didn't set my register properly. But I thought that Timer 1 is timer 1, no matter is TCCR1A or TCCR1B. Why can I set all the timer ...
4
votes
1answer
2k views

Microcontroller memory write cycles

Information show that flash memory have a limited number of write cycles (usually ~10'000). Many MCUs emulate EEPROM in flash, hence some document this write_life_cycle. A look at any MCU datasheet ...
4
votes
2answers
2k views

Problem in writing register maps using C structure for a TI Microcontroller

I am writing register maps in C for a TI ARM based Micro-controller board. Here is the link to the datasheet. I am using the following guidelines on how Register maps should be written in C: ...
4
votes
1answer
143 views

Why is the stored value in each D flip flop reconnected to the input in a buffer register?

Like can one not just connect a single AND gate with the load and X input instead of complicating by reconnecting the output and using another OR gate? Will it be logically the same? or is it that I ...
4
votes
2answers
3k views

How can a shift register be used to debounce a switch?

This is the problem: This is the proposed solution: What I don't understand: The button bounces in the setup/hold time of the input of the circuit, making the FF go into a metastable state whereby ...
3
votes
2answers
4k views

Setup Time, Hold Time - What is the underlying principle for having them?

I'm learning about setup time and hold time of a FF connected to a bus. But the textbook fails to explain exactly why are those needed in an operation. Isn't a FF always powered on and attentive to ...
3
votes
1answer
1k views

Clearing Flag Bits By Writing 1

Most of the interface devices have various flag bits (that can also raise interrupts if that functionality is provided) used to check the status of the device/operation. Usually they are cleared by ...
3
votes
2answers
1k views

early accumulator based machines

Wikipedia says that many of the early machines were accumulator-based machines. My guess is that in those machines the accumulator did not play the role of a speed-up register as do registers in today ...
3
votes
3answers
1k views

Understanding Flip Flops/Registers in Low Level

So I'm reading "Elements of Computing Systems" trying to really understand how everything works underneath (Any other book/article suggestions that would help would be amazing) Since eventually I want ...
3
votes
1answer
1k views

STM32F0 GPIOx_ODR vs GPIOx_BSRR

Apart from the register structure what is the difference between GPIOx_ODR and GPIOx_BSRR? Is GPIOx_BSRR an abstraction layer for GPIOx_ODR? I know that a change in GPIOx_BSRR "will" change the ...
3
votes
2answers
186 views

Is it possible to exchange the content of two registers in a single clock pulse?

There are two register R1 and R2. How is it possible to exchange the content of R1 and R2 in a single clock pulse using Common bus architecture?
3
votes
2answers
5k views

help me to understand ANSEL register in PIC

in new to PIC,this is bit confusing. For switch ,usart we should clear ANSEL regsiter to make as digital IO so then only we can read 0 or 1 from that pin?, data sheet says if we set particular pin ...
3
votes
2answers
7k views

How do I select what values to load in CCPR1L register (for generating PWM signal with PIC)?

I need to generate PWM signal with PIC18F2550 microcontroller at near 20kHz. I read the datasheet, I found it too complex and confusing, then I started to search for a sample code on the net to ...
3
votes
1answer
88 views

Can I use a photodiode as a switch for a shift register?

Let's say I have a photodiode, a shift register (74HC595) and a 5V source, and I connect these as: 5V source -- photodiode -- shift register data input. (And other voltages to feed the register ...
3
votes
2answers
1k views

Confusion between register size, address size, data size

I started learning about pointers in C++ and I figured I should educate myself a bit on how memory works and is accessed. I read that when we say a processor is 64-bit, it has a 64-bit register and ...
3
votes
3answers
2k views

Can I pass a bit register as a function argument in Hi-Tech C compiler for PIC16?

Is there a way to pass a bit from a PIC's register as a function parameter? Taking, for example, the PIC16F887, its registers (SFRs) and individual bits are defined as fallows in the corresponding ...
3
votes
1answer
68 views

Why do we need 'R_out' in 2-BUS arch?

Given some abstract architecture of CPU: Note that this CPU has 2-BUS. Why do we need the R_out and R_in? If I use Gra/Grb/Grc then obviousely I will need R_out. The Same for R_in when I use Sra/Srb/...
3
votes
1answer
209 views

Register behaving like latch in verilog

I have the following block of code - ...
3
votes
1answer
456 views

VHDL code and unintended latches

I am working on coding a Regsiter a1 with input signals b1,rst and wra1 the register ...
2
votes
2answers
1k views

Finite State Machine FSM

I understand how to make state diagram and make combinational logic (gates) to get a boolean equation for the next state bits and the output bit, but what is the function of ROM here ?
2
votes
2answers
841 views

What is this array-like notation of registers in datasheets?

I am reading BMP280 datasheet (pressure&temperature sensor). On different pages they use the following notation: $$register\text{_}name[a:b]$$ where a, b are integers. For example, on page 13 "...
2
votes
3answers
2k views

Does Registers and RAM are same kind of memory?

Recently, I found out a YT channel of a man who build a 8-bit computer and explain how. In his video on the registers, he uses a D flip-flop, and in his other video on the ram, I understood that he ...
2
votes
1answer
521 views

MSP430 RAM protection

I'm looking at the user guide for the MSP430x5xx family. It says there in section 9.1 that: ...
2
votes
5answers
293 views

How does register type modifier work on different CPU architectures?

This question is to clarify my doubt against this register storage class. when a variable is register qualified ,compiler puts the variable in a cpu register other than RAM for ease of access. so ...
2
votes
2answers
2k views

What is the meaning of “Register.Rd”?

Reading Hennesy's book "Computer Organization and Design" it is mentioned "Register.Rd" and "Register.Rs" but what does it mean? The .Rd, .Rt and .Rs parts I can't understand, on page 365:
2
votes
2answers
1k views

Verilog asynchronous reads of regs - and design question

I'm trying to understand what the following bit of behavioral code, what kind of hardware it turns into: ...
2
votes
1answer
156 views

AVR registers location

There are four types of registers in AVR. \$r_0\$ - \$r_{15}\$ witch used for CPU's calculations. \$r_{16}\$ - \$r_{31}\$ witch used for user's temporary data storage. Registers for I/O statements. ...
2
votes
1answer
637 views

Verilog register output: reg or wire?

If I want to model a simple register I would expect to have an internal 'reg' element to hold the value and I would connect this with a 'wire' output. The reg drives an internal output. However, I'...
2
votes
1answer
502 views

Eliminating Signal Race Hazard in an IC dynamic latch/register!

I work in MAGIC Integrated Circuit software at layout-level. I got an 8bit dynamic register made of 1bit dynamic flipflops that write input on the positive edge of the signal: (Note: I used ...
2
votes
4answers
1k views

What is important in computer clocks' signal: signal edges or intervals when signal is stable? Will multiple value propagation occur?

I am trying to figure out some basics of digital electronics. We have all seen the squared graph of the computer clock signal: I have read multiple articles on the Internet and still can't figure out ...
2
votes
3answers
72 views

Clock domain cross and metastablilty problem

I understand the problem of metastability and understand that we can't get a stable value in a bounded time so we need unbonded time but it is not practical, so we put another flip flop with no ...
2
votes
2answers
414 views

VHDL 4-bit Shift-and-Add Multiplier Buffer and Out port error

I am working on a creating a 4-bit Shift-and-Add Multiplier. I am getting this warning message - "WARNING:HDLParsers:3555 - "//filer1.egr.msu.edu/samarar1/ece230/Project05/Project05.vhd" Line 220. ...
2
votes
2answers
2k views

How many servos can I run on an ATtiny85?

This is my first time asking a question on this website, so please correct me if I'm doing something wrong... I have been working on a small project which runs three Servo motors on an ATtiny85, ...
2
votes
2answers
2k views

Which register holds the final arithmetic and logic results?

This Wikipedia page says an accumulator is a register in which intermediate arithmetic and logic results are stored. So which register holds the final result?
2
votes
2answers
979 views

How to change reg in two different always blocks?

How can I change/alter a register's value in two different always blocks for synthesizeability? For example: ...