TAILIEUCHUNG - Tasks And Functions part 1

[ Team LiB ] Differences between Tasks and Functions Tasks and functions serve different purposes in Verilog. We discuss tasks and functions in greater detail in the following sections. However, first it is important to understand differences between tasks and functions | Team LiB Differences between Tasks and Functions Tasks and functions serve different purposes in Verilog. We discuss tasks and functions in greater detail in the following sections. However first it is important to understand differences between tasks and functions as outlined in Table 8-1. Table 8-1. Tasks and Functions Functions Tasks A function can enable another function but not another task. A task can enable other tasks and functions. Functions always execute in 0 simulation time. Tasks may execute in non-zero simulation time. Functions must not contain any delay event or timing control statements. Tasks may contain delay event or timing control statements. Functions must have at least one input argument. They can have more than one input. Tasks may have zero or more arguments of type input output or inout. Functions always return a single value. They cannot have output or inout arguments. Tasks do not return with a value but can pass multiple values through output and inout arguments. Both tasks and functions must be defined in a module and are local to the module. Tasks are used for common Verilog code that contains delays timing event constructs or multiple output arguments. Functions are used when common Verilog code is purely combinational executes in zero simulation time and provides exactly one output. Functions are typically used for conversions and commonly used calculations. Tasks can have input output and inout arguments functions can have input arguments. In addition they can have local variables registers time variables integers real or events. Tasks or functions cannot have wires. Tasks and functions contain behavioral statements only. Tasks and functions do not contain always or initial statements but are called from always blocks initial blocks or other tasks and functions. Team LiB Team LiB Tasks Tasks are declared with the keywords task and endtask. Tasks must be used if any one of the following conditions is true for the procedure

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.